Tagged: ,

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #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

    #895878

    Here 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.

    https://imgur.com/8ahTLAI

    • This reply was modified 6 years, 10 months ago by Itai.
    #896671

    anyone?

    #897130

    Hi,

    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,
    Nikko

    #897282

    Thanks 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?

    #897341

    Hi,

    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

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.