Running on the current nuget version of Magick.NET-Q8-AnyCPU (7.0.5.500) I hit a very strange bug. For input I have an oddly sized tiff:
My app takes that input, rotates it 90 degrees, resizes it down to something much smaller, then saves it as a jpeg:
If I remove the call to Resize(), the output jpeg file is fine:
{Tiff 7200x4792 1-bit Gray 124.21kB}
The image is predominately white with some black drawing and text on it.My app takes that input, rotates it 90 degrees, resizes it down to something much smaller, then saves it as a jpeg:
MagickImage img = new MagickImage("Input.tiff");
img.Rotate(90);
img.Resize(700, 0);
img.Format = MagickFormat.Jpeg;
img.Write("Output.jpg");
The resulting output file is an entirely black image.If I remove the call to Resize(), the output jpeg file is fine:
MagickImage img = new MagickImage("Input.tiff");
img.Rotate(90);
img.Format = MagickFormat.Jpeg;
img.Write("Output.jpg");
Alternatively, if I leave the Resize() in place and save the file as a Png24, the the output file is fine:MagickImage img = new MagickImage("Input.tiff");
img.Rotate(90);
img.Resize(700, 0);
img.Format = MagickFormat.Png24;
img.Write("Output.png");
Now, this is where it gets strange ... leaving the Resize() call in place, if I save the file 1st as a PNG and then as a JPG, the output jpg file is fine:MagickImage img = new MagickImage("Input.tiff");
img.Rotate(90);
img.Resize(700, 0);
img.Format = MagickFormat.Png24;
img.Write("Output.png");
img.Format = MagickFormat.Jpeg;
img.Write("Output.jpg");
Any thoughts as to what is going on under the hood?