Image is changed and made larger when no processing is requested. #208

Closed
dsargent3220 opened this Issue Aug 25, 2015 · 3 comments

Comments

Projects
None yet
3 participants
@dsargent3220

Good morning. I was just testing the case where we want ImageProcessor.Web to output and cache the image but not change it in any way and found the cached image file ended up bigger (in terms of file size) than the source.

I'm attaching both images below.
The only "custom" code we have is Remote Image Service that specializes how to load the image from our back end server. It's pretty much a copy of the built in remote image service with some minor modifications we needed, none of which should affect the image AFAIK.

The source is 526K and the cached version is 572. I don't know how to see what is different in them. Their resolution is the same. The only thing I can think of is that I've seen this kind of thing when using PNG Crush (sometimes images get bigger when crushed). Is it a difference in the compression algorithm used?

Is there a way to tell ImageProcessor.web to do nothing to the image except cache it?

Here they are.
849_callouts
9eb4b3c7d467a9f974ba00b0121ab20cec577d5c

@kenyus

This comment has been minimized.

Show comment
Hide comment
@kenyus

kenyus Aug 25, 2015

+1 for me too
I have similar problem with trying to output image without modifying it, in my case the image is also PNG but file size is shrink from 1MB to nearly 200KB which obviously means lost in quality as the image looks much horrible.
Again how can we output the image without changing quality? As we want to utilise the same method of caching and validating our protected images.

kenyus commented Aug 25, 2015

+1 for me too
I have similar problem with trying to output image without modifying it, in my case the image is also PNG but file size is shrink from 1MB to nearly 200KB which obviously means lost in quality as the image looks much horrible.
Again how can we output the image without changing quality? As we want to utilise the same method of caching and validating our protected images.

@JimBobSquarePants

This comment has been minimized.

Show comment
Hide comment
@JimBobSquarePants

JimBobSquarePants Aug 25, 2015

Owner

@dsargent3220 What you're seeing is down to the built in .NET encoder - It's not great so I'm trying to work on a way to improve the output. The current development code will bypass the .NET encoder if no processing is needed but uses post processing to ensure that the output is as optimized as possible. Could you build from source (sorry, no nightlies yet) and test against that?

@kenyus Something doesn't seem right about your description. For an image to shrink 800kb simply by resaving it seems infeasible to me. Do you have postprocessing installed? Are you changing format? Is it actually a png or a bitmap with the incorrect extension.

Could you post the original image online?

@dsargent3220 What you're seeing is down to the built in .NET encoder - It's not great so I'm trying to work on a way to improve the output. The current development code will bypass the .NET encoder if no processing is needed but uses post processing to ensure that the output is as optimized as possible. Could you build from source (sorry, no nightlies yet) and test against that?

@kenyus Something doesn't seem right about your description. For an image to shrink 800kb simply by resaving it seems infeasible to me. Do you have postprocessing installed? Are you changing format? Is it actually a png or a bitmap with the incorrect extension.

Could you post the original image online?

JimBobSquarePants added a commit that referenced this issue Aug 26, 2015

Bypass .NET encoders when not processing.
Images with no processing requirements no longer go through the
ImageFactory pipeline. They will still however be cached and optionally
postprocessed. #208
@JimBobSquarePants

This comment has been minimized.

Show comment
Hide comment

Fixed in v4.4.0

nul800sebastiaan pushed a commit to nul800sebastiaan/ImageProcessor that referenced this issue Feb 3, 2016

Bypass .NET encoders when not processing.
Images with no processing requirements no longer go through the
ImageFactory pipeline. They will still however be cached and optionally
postprocessed. #208

rtyley pushed a commit to bfg-repo-cleaner-demos/ImageProcessor that referenced this issue Apr 4, 2016

Bypass .NET encoders when not processing.
Images with no processing requirements no longer go through the
ImageFactory pipeline. They will still however be cached and optionally
postprocessed. #208


Former-commit-id: 6e807cf
Former-commit-id: 8c808d59ab8ee5ea4b7c85549e9286edf9376aef
Former-commit-id: 0bc164c
Former-commit-id: fe33138e9c398b889d97bb1d358b54c323ab1308

JimBobSquarePants added a commit that referenced this issue Oct 27, 2016

Bypass .NET encoders when not processing.
Images with no processing requirements no longer go through the
ImageFactory pipeline. They will still however be cached and optionally
postprocessed. #208


Former-commit-id: 6e807cf
Former-commit-id: 8c808d59ab8ee5ea4b7c85549e9286edf9376aef

JimBobSquarePants added a commit that referenced this issue Oct 27, 2016

Bypass .NET encoders when not processing.
Images with no processing requirements no longer go through the
ImageFactory pipeline. They will still however be cached and optionally
postprocessed. #208


Former-commit-id: cd34cc5
Former-commit-id: fdc3a24e57f02202aabdf85a19590c830d0198eb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment