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

Create image_processing.py #673

Merged
merged 1 commit into from
Jun 14, 2021
Merged

Create image_processing.py #673

merged 1 commit into from
Jun 14, 2021

Conversation

MaxJa4
Copy link
Contributor

@MaxJa4 MaxJa4 commented Jun 8, 2021

Added central function to rescale and compress images for recipes (or in general).
Switched from previously used PNG format to 75% JPEG format for a 5-10x file size reduction with hardly any quality loss.

Added central function to rescale and compress images for recipes (or in general).
Switched from previously used PNG format to 75% JPEG format for a 5-10x file size reduction with hardly any quality loss.
@MaxJa4
Copy link
Contributor Author

MaxJa4 commented Jun 8, 2021

Feel free to move this file to a more suitable location as you see fit.

@vabene1111
Copy link
Collaborator

thanks very much, i will take a look at implementing this accross the application

@MaxJa4
Copy link
Contributor Author

MaxJa4 commented Jun 9, 2021

Maybe a one time execution after the next update containing this feature would be a good idea to compress all already existing pictures.

I'm gonna make a little test and do that with my instance manually to see how much smaller the overview page gets and how faster it loads (the first time, since caching is active on my page).

@vabene1111
Copy link
Collaborator

i am always worried with file migrations but you are generally right .. we will see what can be done after installing

@MaxJa4
Copy link
Contributor Author

MaxJa4 commented Jun 9, 2021

That's true... maybe implementing it in one version and migrating the existing files (just PNGs) in the following version reduces that migration risk a little since the new compression has been tested live already (which should be fine but you never know).

@MaxJa4
Copy link
Contributor Author

MaxJa4 commented Jun 9, 2021

Previous format (like the pictures were rescaled before; 70% PNG; reload without caching):
image

New format (75% JPEG optimized; reload without caching):
image

This was on the /search/ site (my default site). I'd call it a success :)

On a single recipe (not a huge difference here):

Previous:
image

New:
image

@vabene1111
Copy link
Collaborator

i think that sounds very good 👍

@vabene1111 vabene1111 added this to the 0.16.x milestone Jun 10, 2021
@vabene1111 vabene1111 merged commit c91fc09 into TandoorRecipes:develop Jun 14, 2021
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

Successfully merging this pull request may close these issues.

2 participants