Tagged: Images
-
AuthorPosts
-
March 18, 2020 at 1:27 pm #1194101
Hi, I have noticed that the generated images used by enfold are larger in file size (KB) than the original upload image.
I wanted to ask if there is a way to force enfold to reference the original uploaded image as a source, rather than the odd-sized images my site and enfold seems to create for the masonry grid XXX-705×415.jpg and XXX-845×321.jpg on a post page.So the two I’d like to change are
featured image on postand
Masonary grid
I’m happy for the CSS to crop the picture in a typical way on enfold, just wanted the source image to be original upload file.
Hope that makes sense.
March 21, 2020 at 10:51 am #1195038Can anyone help with this issue?
March 23, 2020 at 4:28 am #1195339Hi,
Sorry for the delay. The generated thumbnail is probably larger because the theme automatically sets the default image compression setting to the highest quality possible. If you want to override it, try to add this snippet in the functions.php file.
function av_return_100(){ return 65; } add_filter('jpeg_quality', 'av_return_100'); add_filter('wp_editor_set_quality', 'av_return_100');
You can adjust the return value 65 to something else. Default value is 100.
Best regards,
IsmaelMarch 23, 2020 at 11:28 am #1195418Hi Ismael, Thanks for getting back to me. What seems to be happening is odd physical size are being generated. So in the masonry element the background images all have variably pixel dimensions ( 705×409.jpg ) and ( 705×440.jpg ). It looks like enfold is generating these size, the problem is these sizes are not optimised imagify. So I was asking for a way to force the masonry element to use a fixed thumbnail size like maybe ( portfolio – 495 × 400 )?
March 26, 2020 at 6:15 am #1197944Hi,
The size of the masonry thumbnails vary because the theme is scaling the images instead of cropping them, leaving their aspect ratio intact. If you want to crop the images to the exact dimension regardless of their aspect ratio, you have enable cropping or set the crop parameter of the add_image_size function to true. You can do that manually by editing the predefined thumbnail parameters in functions.php file or by defining your own “masonry” thumbnail using the add_image_size function.
$avia_config['imgSize']['masonry'] = array('width'=>705, 'height'=>705 , 'crop' => false); // images for fullscreen masonry
// https://developer.wordpress.org/reference/functions/add_image_size/
Or you can use this plugin to enable cropping for the “masonry” thumbnails.
// https://wordpress.org/plugins/simple-image-sizes/
You have to regenerate the thumbnails after updating the parameters.
Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.