Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

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

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

dsargent3220 opened this issue Aug 25, 2015 · 3 comments

Comments

@dsargent3220
Copy link

@dsargent3220 dsargent3220 commented Aug 25, 2015

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
Copy link

@kenyus 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
Copy link
Owner

@JimBobSquarePants JimBobSquarePants commented Aug 25, 2015

@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
Images with no processing requirements no longer go through the
ImageFactory pipeline. They will still however be cached and optionally
postprocessed. #208
@JimBobSquarePants
Copy link
Owner

@JimBobSquarePants JimBobSquarePants commented Sep 20, 2015

Fixed in v4.4.0

rtyley pushed a commit to bfg-repo-cleaner-demos/ImageProcessor that referenced this issue Apr 4, 2016
Images with no processing requirements no longer go through the
ImageFactory pipeline. They will still however be cached and optionally
postprocessed. JimBobSquarePants#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
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
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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.