For linlked image, cannot generate thumbnail with this code.
Generated PNG file same sized as source JPG.
void Test()
{
var size = new System.Drawing.Size(96, 96);
var pageNumber = 1;
var filePath = @“sample.JPG”;
var target = filePath + $“_{pageNumber}.png”;
using (var converter = new GroupDocs.Conversion.Converter(filePath))
{
GroupDocs.Conversion.Contracts.SavePageStream thumbStream = page => new FileStream(target, FileMode.Create);
var options = new GroupDocs.Conversion.Options.Convert.ImageConvertOptions
{
Pages = { 1 },
Format = GroupDocs.Conversion.FileTypes.ImageFileType.Png,
PageNumber = pageNumber,
Width = size.Width,
Height = size.Height
};
converter.Convert(thumbStream, options);
}
}