We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Aspose.Imaging Save throw Exceptions after cropped to 1*1

Hi Aspose team,

We’re using Aspose.Imaging.dll v20.3 to manipulate images. However, when we crop an .webp image to 1*1 size, and save it, an exception is thrown with messaging “ConvertRowsToUv assign pixel error!”. JPEG2000 files works no problem.

Our code is simple :

var image = Image.Load(path) as WebPImage;
image.Crop(rect);  // after crop, we can see image size has changed to 1*1 when debug
image.Save(destPath); // exception throws here

Here is the Stack trace

"   at \u0003   .\u0002(Int32[] \u0002, Int32 \u0003, Int32 \u0005, Int32 \b, \u0005    \u0006)\r\n   at \u0003   .\u0002(Int32[] \u0002, Int32 \u0003, Int32 \u0005, Single \b)\r\n   at \u000f   .\u0002(Int32[] \u0002, Int32 \u0003, Int32 \u0005, Boolean \b)\r\n   at \u0006   .\u0005()\r\n   at \u0006   .\u0002()\r\n   at Aspose.Imaging.FileFormats.Webp.WebPImage.SaveData(Stream stream)\r\n   at Aspose.Imaging.DataStreamSupporter.Save(Stream stream)\r\n   at Aspose.Imaging.DataStreamSupporter.Save(String filePath)\r\n   at 
.....(our code)

PS : we also found that image.Rotate() and image.Crop() will throw exceptions when rotate/crop small pixels of image, for example, 1x10, 2x5 …
PS2: image.Load() seem to have the same issue when manipulating low resolution images

@MagejiTerran

Can you please provide the source file that you have used on your end. Please also try using Aspose.Imaging for .NET 21.7 on your end as well for this.