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

Generated image is bigger than original #17

Open
lovato opened this issue Jun 26, 2014 · 2 comments
Open

Generated image is bigger than original #17

lovato opened this issue Jun 26, 2014 · 2 comments

Comments

@lovato
Copy link

lovato commented Jun 26, 2014

Please, validate this.
When opening this, https://pbs.twimg.com/media/Bq1dN3lIEAAgQbv.jpg, a 800px wide image, I got on chrome inspect a 33.2k size.
If I pass it through FlaskImages, default quality (75), and ask for 800 px as width output, I got a 33.7k size.

I am doing imgsizer/remote?w=800&u=https://pbs.twimg.com/media/Bq1dN3lIEAAgQbv.jpg

What do you think if FlaskImages, after generating the final file, knowing that the original is smaller, deliver and cache the original, as if it was generated by itself.

I know it depends on the original image, but it did happen sometimes.

Best
Lovato

@mikeboers
Copy link
Owner

I have verified your result.

So if the derived output size exactly matches the input, and is the same format, then we can consider returning the original image.

I wonder if there are any other side-effects (metadata, etc.) that we would always want to maintain, and I wonder how well this would play with the storage abstraction that is being discusses in the GAE compatibility issue (#13).

Hmm...

@lovato
Copy link
Author

lovato commented Jun 26, 2014

Indeed, i tought that too.

Meanwhile, I ended starting a generic FlaskImages service for my app,
hosted on Dreamhost, which i have full I/O access.
Then I discovered this when checking how my app was behaving.

What surprised me was the default=75. I tough the default was 95, and this
was to be the explanation for the similar size file. When trying to lower
it, I found the "problem".
So, if we try to get a q=90 for this file, it will be (more) bigger than
the original.

Perhaps after generating the image, do this analysis and determine which
file to store as "generated" (no matter where it came from). For sure it
will be (or must be) the optimal.
Do FI rewrite file metadata or just update the changes in comparison with
the original one?

Best,

[]s

Lovato

sent from GMail

On Thu, Jun 26, 2014 at 9:15 AM, Mike Boers [email protected]
wrote:

I have verified your result.

So if the derived output size exactly matches the input, and is the same
format, then we can consider returning the original image.

I wonder if there are any other side-effects (metadata, etc.) that we
would always want to maintain, and I wonder how well this would play with
the storage abstraction that is being discusses in the GAE compatibility
issue (#13 #13).

Hmm...


Reply to this email directly or view it on GitHub
#17 (comment)
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants