.NET 9 - Cannot convert image

Using GroupDocs.Conversion 25.4.0 in .NET 9 the attached image fails to convert with the following error.

img_0444.jpg (180.9 KB)

I’m also not sure why this has uploaded as .jpg it should be a .png

GroupDocs.Conversion.Exceptions.CorruptOrDamagedFileException: ‘Cannot convert. The file is corrupt or damaged. Could not load file or assembly ‘System.Drawing.Common, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51’. The system cannot find the file specified.’

The GroupDocs.Conversion 25.4 Nuget package has a dependency on an older version of System.Drawing.Common?

Conversion code:

LoadOptions GetLoadOptions(LoadContext context)
{
    var loadOptions = new ImageLoadOptions()
    {
        Format = (ImageFileType)FileType.FromExtension(fileExtension)
    };

    return loadOptions;
}

var fs = new MemoryStream();

using var converter = new Converter(convertedFilePath, (lc) => GetLoadOptions(lc));
var convertOptions = new PdfConvertOptions();
converter.Convert(convertOptions, (Action<ConvertedContext>)(context =>
{
    context.ConvertedStream.CopyTo(fs);
}));
fs.Seek(0, SeekOrigin.Begin);
1 Like

@rthomas95
This issue is reproduced at our end. Therefore, we have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): CONVERSIONNET-7749

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.