Tagged: Images, optimizing
-
AuthorPosts
-
January 10, 2018 at 9:57 pm #895823
Hello,
I’ve decided to manually optimize my images on our homepage layerslider. Using Optimizilla I painstainkingly evaluated every Kb as I dailed in the lowest possible value.
I disable all image optimizing plugins on my site.
However once I upload and analyze my site, it turns out that my 1500×1000 pixel jpeg bloats by 10k (from 20K to 30K).
My guess is that the theme is regenerating the image, even though it’s already at the 1500×1000 size.
Is there anything I can do to keep this from happening?Cheers,
itai
January 11, 2018 at 12:00 am #895878Here is what I mean. Below my original uploaded file and a generated (by enfold I guess?) image.
Both images are of the same pixel height and width yet the one used in the slider is 30% more Kb.- This reply was modified 6 years, 11 months ago by Itai.
January 12, 2018 at 8:50 pm #896671anyone?
January 14, 2018 at 7:04 pm #897130Hi,
Honestly, I’m also puzzled why it became bigger, I tested the image on my end. This is more of a wordpress issue than Enfold since we are using add_image_size() function of wordpress for generating image sizes: https://developer.wordpress.org/reference/functions/add_image_size/
I can only guess that the image editor you used have better compression tool than the one wordpress uses.Best regards,
NikkoJanuary 15, 2018 at 1:34 am #897282Thanks Nikko,
On that page it says:
Other Notes: #Other Notes:
Using the ‘false’ setting will fail to produce a new image in the upload directory if one of the image dimensions of the uploaded image are equal to the new image size.How do I implement that for my 1500 x 1000 Pixel images in my child theme functions.php?
January 15, 2018 at 4:24 am #897341Hi,
Yes, if the image uploaded has the same size it will not generate a cropped version of the image, though the width is the same the height isn’t that’s why it’s still generating. You can implement that by going to functions.php and find this line of code (line 148):
$avia_config['imgSize']['featured'] = array('width'=>1500, 'height'=>430 );
replace height 430 with 1000. One thing to note is that you need to regenerate the image or re-upload the image again before the function works.
Best regards,
Nikko -
AuthorPosts
- You must be logged in to reply to this topic.