I can't preview the image after I resize it
Posted: 2018-11-15T08:36:46-07:00
I tried it with the CLI tool and in C# with Magick.NET. I get the same result. After the resize, I can't preview the image anymore.
When I try to open the image for preview I get this message: "Windows Photo Viewer can't open this picture because the file appears to be damaged, corrupted, or too large.".
CLI command which I have used:
And this is the C# code:
This is the original image: https://ufile.io/x1d1u
This is the resized image: https://ufile.io/rlc04
When I try to open the image for preview I get this message: "Windows Photo Viewer can't open this picture because the file appears to be damaged, corrupted, or too large.".
CLI command which I have used:
Code: Select all
magick convert -resize 1024 123_original.jpg 123_resized.jpg
Code: Select all
using (MagickImage image = new MagickImage(destinationImagePath))
{
if (newWidth < image.Width)
{
image.Resize(newWidth, 0);
}
image.Write(destinationImagePath);
}
This is the resized image: https://ufile.io/rlc04