Closed saintarian closed 2 years ago
based on the output you provided you can see the image has a 19mb XMP profile (we don't touch that when re-encoding, we leave that up to you to manage) you need to make sure you null
out that profile before calling save.
image.Metadata.XmpProfile = null;
you for other images withthsi same behaviour it might be a different profile at fault so you might want to also set the ExifProfile
, IccProfile
, and IptcProfile
s to null too... but your millage may vary
it was this section of output you provided that you want to lookout for.
Profiles:
Profile-xmp: 19227987 bytes
Got it - thank you @tocsoft! That did it.
Prerequisites
DEBUG
andRELEASE
modeImageSharp version
2.1.0
Other ImageSharp packages and versions
None
Environment (Operating system, version and so on)
MacOS 12.1 on M1 chip
.NET Framework version
6.0
Description
I expect the image size after resize to be less than max number of pixels (1024723) number of channels (3). It ends up being ~19MB. Running the code below (an xunit test) shows the issue.
output of
magick identify -verbose original.png
:Output of
magick identify -verbose resized.jpg
:Steps to Reproduce
Images
Using links because images are large:
Original: https://nyckel-public.s3.us-west-2.amazonaws.com/resize-issue-original.png
Resized: https://nyckel-public.s3.us-west-2.amazonaws.com/resize-issue-resized.jpeg