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

Free Support Forum - aspose.com

Top part of image is not aligned after resize

Hello, I have attached a couple images that i used during my test.

When I load image 1 and resize it, the top half looks askewed to the right. I know i can open the file directly to an image but in my production code, the data is delivered to me as a byte[], that is why i did it this way for my example

Here is my test code:

byte[] img1Data = Database.GetImage(“Images/img1.jpg”);

using (MemoryStream ms = new MemoryStream(img1Data))
{
using (Image image = Image.Load(ms))
{
image.Resize(136, 163);

using (MemoryStream outImage = new MemoryStream())
{
image.Save(outImage, new JpegOptions());

Database.SaveImage(“Images/test5.jpg”, outImage.ToArray());
}
}
}

on taking a closer inspection, it looks like maybe the top part may be flipped?

Hi Chris,


Thank you for contacting the Aspose support.

We have evaluated your presented scenario while using the latest version of Aspose.Imaging for .NET 2.7.0 in license mode, and we are unable to replicate the problem as demonstrated in your provided snapshot. We would request you to please acquire a 30 day temporary license in order to evaluate the Aspose.Imaging APIs without any evaluation restrictions. Once you receive the license file via an email, please set the license as follow.

C#

Aspose.Imaging.License license = new Aspose.Imaging.License();
license.SetLicense(@“path to .lic file”);