Archived topic
number and quality of images generated by GP
5 replies · Started by David on January 20, 2017
Hi Tom,
if i'm right it seems GP (I have the premium version) generates 9 different sizes of each uploaded image. This is a lot and I think I don't need most of those versions. I have more than 300 images in my library and it will grow in the future.
Is there a way to limit the number of sizes?
Also I have the feeling those images are very compressed although I need quality more than lightness because the website is a paintings portfolio and shop. Do I have a way to setup the compression?
I know I may use plugins for this, but i had already so many plugins installed... It could be better to change the theme settings.
Hi there,
By default, GP doesn't generate any additional sizes on upload.
However, if you set the image width and height of your featured images (https://docs.generatepress.com/article/adjusting-the-featured-images/), GP will generate those sizes for each of the images you upload as featured images.
For the quality, adding a function like this might help:
add_filter( 'jpeg_quality', create_function( '', 'return 100;' ) );
Thanks Tom!
No problem :)
How to insert this code? in functions.php
I inserted code at the end of the file.
so right?
}
// No compression jpeg images when uploading
add_filter( 'jpeg_quality', create_function( '', 'return 100;' ) );
}
endif;
But the image is not better...
How to set image upload no compression?
Try adding the code exactly as you see it here: https://generatepress.com/forums/topic/number-and-quality-of-images-generated-by-gp/#post-266236
Using these instructions: https://docs.generatepress.com/article/adding-php/