• SVargo

    (@svargo)


    Hi,

    My thumb image file size gets about double the size of the original posted feature image.

    My original images are 420×500/840×1000 and the file size varies around 15-30kb per image. Though when resized by wordpress/woocommerce into a thumb to 340×340(crop) the image size gets to 50kb+.
    Since the image is smaller one would think that the file size would get smaller, though it doesnt.

    Any ideas?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi,

    I have exactly the same problem. I have deliberately uploaded a very low quality jpg image, 1,078px wide, 40 KB. When I use this image as a featured image (same width, slightly less height), the file size jumps to 150 KB. What does WordPress do with the original file that adds 110 KB?

    I have tested with different image dimensions, compression tools, compression rates, and many different images. I have not managed to understand why image file sizes of thumbs sometimes get significantly larger than the original image file.

    Anyone who knows why this behaviour occurrs and what could be done to avoid it?

    Thread Starter SVargo

    (@svargo)

    Hey WalleP,
    I fixed this issue somehow, though quite some time ago. I believe I changed the jpeg quality

    “add_filter( ‘jpeg_quality’, create_function( ”, ‘return 100;’ ) );” to
    “add_filter( ‘jpeg_quality’, create_function( ”, ‘return 80;’ ) );”.

    Not sure though, but worth a try if you haven’t tried it yet.

    Cheers, hope you’ll fix it.

    Thread Starter SVargo

    (@svargo)

    Try putting this in functions.php.
    I believe this fixed it.

    // Change the jpeg quality
    function gpp_jpeg_quality_callback($arg)
    {
    return (int)75;
    }

    add_filter(‘jpeg_quality’, ‘gpp_jpeg_quality_callback’);

    add_filter(‘widget_text’,’execute_php’,100);
    function execute_php($html){
    if(strpos($html,”<“.”?php”)!==false){ ob_start(); eval(“?”.”>”.$html);
    $html=ob_get_contents();
    ob_end_clean();
    }
    return $html;
    }

    Cheers

    I am having the same issue.
    I’m optimising the images via Photoshop so I have set the WordPress jpeg quality to 100% via the jpeg_quality filter:
    add_filter( 'jpeg_quality', create_function( '', 'return 100;' ) );

    My original file is 607KB from photoshop @ 2400 x 3106px
    All the sizes I resize to are smaller than the original.
    1st resized image: 3.1MB @ 2048 x 2650px (how the hell did this happen?)
    2nd resized image: 1.5MB @ 2048 x 1280px
    3rd resized image: 1.5MB @ 2000 x 1250px
    4th resized image: 2.6MB @ 1920 x 2400px
    and so it goes on.
    It’s only once the resized image widths fall below 1000px that the file sizes are below the original.

    Can anyone explain why?
    WordPress issue or GD issue?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Thumb image file size bigger than original’ is closed to new replies.