Title: Problem image size
Last modified: May 4, 2022

---

# Problem image size

 *  Resolved [Remco Tolsma](https://wordpress.org/support/users/remcotolsma/)
 * (@remcotolsma)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/problem-image-size-3/)
 * Hello SiteGround,
 * We have a theme with the following image sizes:
 *     ```
       add_image_size( 'square', 600, 600, true );
       add_image_size( 'featured', 600, 400, true );
       ```
   
 * If we upload a 640×360 pixels image the “-600×360” version of the image is corrupt.
 * If we disable the “SiteGround Optimizer” plugin and regenerate the images with
   [https://wordpress.org/plugins/regenerate-thumbnails/](https://wordpress.org/plugins/regenerate-thumbnails/)
   the “-600×360” version is no longer corrupt.
 * Please note that both image sizes ‘square’ and ‘featured’ result in one ‘thumbnail’
   image file:
    - square: 600×600 pixels (crop) image-600×360.jpg
    - featured: 600×400 pixels (crop) image-600×360.jpg
 * This is probably the crux of the problem.
 * Remco Tolsma
    Pronamic
    -  This topic was modified 4 years, 1 month ago by [Remco Tolsma](https://wordpress.org/support/users/remcotolsma/).

Viewing 10 replies - 1 through 10 (of 10 total)

 *  Plugin Support [Delyan Delov](https://wordpress.org/support/users/delyandelov/)
 * (@delyandelov)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/problem-image-size-3/#post-15616117)
 * Hi [@remcotolsma](https://wordpress.org/support/users/remcotolsma/),
 * I have carefully reviewed the reported issue and tried to recreate it on my end.
   However, when an image with size 640×360 pixels is uploaded, the crop image size-
   600×360 was created successfully and it is fully accessible.
 * The issue most probably is caused by the theme your site is using. Could you 
   please provide us with the exact URL you are experiencing the issue with so we
   can try investigating the case further?
 *  Thread Starter [Remco Tolsma](https://wordpress.org/support/users/remcotolsma/)
 * (@remcotolsma)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/problem-image-size-3/#post-15620971)
 * Thanks for your response, it’s not related to the theme. I have setup a test /
   demo environment.
 * **URL:** [http://remcot12.sg-host.com/](http://remcot12.sg-host.com/)
    **WordPress:**
   5.9.3 **Theme:** Twenty Twenty-Two
 * **Plugins:**
    - Regenerate Thumbnails
    - SiteGround Optimizer
    - SiteGround Optimizer topic 15615072
 * The “SiteGround Optimizer topic 15615072” plugin contains the following code:
 *     ```
       <?php
       /**
        * Plugin Name: SiteGround Optimizer topic 15615072
        */
   
        add_action( 'after_setup_theme', function() {
       	add_image_size( 'square', 600, 600, true );
       	add_image_size( 'featured', 600, 400, true );
       } );
       ```
   
 * See attachment:
    [http://remcot12.sg-host.com/klepperwei-mei-2022-9-2/](http://remcot12.sg-host.com/klepperwei-mei-2022-9-2/)
 * Corrupt image:
    [http://remcot12.sg-host.com/wp-content/uploads/2022/05/Klepperwei-mei-2022-9-600×360.jpg](http://remcot12.sg-host.com/wp-content/uploads/2022/05/Klepperwei-mei-2022-9-600×360.jpg)
 * Other resize image:
    [http://remcot12.sg-host.com/wp-content/uploads/2022/05/Klepperwei-mei-2022-9-150×150.jpg](http://remcot12.sg-host.com/wp-content/uploads/2022/05/Klepperwei-mei-2022-9-150×150.jpg)
 * Please note the following settings “WordPress admin dashboard” → “SG Optimizer”
   → “Media”:
 * > Image compression level is **Low (25%)**
   > Original images backups are **Disabled**
 * If you need access to the test / demo environment you can reach me via [remco@pronamic.nl](https://wordpress.org/support/topic/problem-image-size-3/remco@pronamic.nl?output_format=md).
 *  Plugin Support [Georgi Ganchev](https://wordpress.org/support/users/georgiganchev/)
 * (@georgiganchev)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/problem-image-size-3/#post-15621952)
 * Hello [@remcotolsma](https://wordpress.org/support/users/remcotolsma/)
 * The issue is caused by the custom add_image_size parameter that is overwritten
   when the image compression is applied by the SG Optimizer. This happens only 
   when the image that you upload is with the same pixels – 640×360 and the extension
   is .jpg. If the image dimensions are different the resized image doesn’t get 
   corrupted.
 * There are a few possible alternatives in such a scenario:
 * — You may modify the add_image_size parameter within your template to a lower
   value(under x360) which will not cause the image to be overwritten and corrupted.
 * — You may enable the “Back up all original images” option from the Image compression
   tab in SG Optimizer. The sequence happens in a different manner which allows 
   the image to be resized successfully without getting corrupted.
 * Best regards,
    Georgi Ganchev
 *  Thread Starter [Remco Tolsma](https://wordpress.org/support/users/remcotolsma/)
 * (@remcotolsma)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/problem-image-size-3/#post-15622020)
 * Is it not possible to solve the problem in the SiteGround Optimizer plugin? If
   not, can you explain why not? In which filter / action is the problem?
 *  Plugin Support [Plamen M](https://wordpress.org/support/users/plamenm/)
 * (@plamenm)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/problem-image-size-3/#post-15623097)
 * Hello Remco,
 * The issue is caused because your theme is adding to the site a custom image size
   of 640×360. This is hen overwritten when the image compression is enabled.
 * You may choose to disable the Image Compression setting in he Optimizer Plugin
   to prevent the corruption of this custom image size.
 * Regards,
    Plamen.M Tech Support Team SiteGround.com
 *  Thread Starter [Remco Tolsma](https://wordpress.org/support/users/remcotolsma/)
 * (@remcotolsma)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/problem-image-size-3/#post-15627231)
 * Do you fully understand the problem? If we disable the SiteGround Optimizer plugin
   there is no problem. So the issue is **not** caused by our theme, but by the 
   SiteGround Optimizer plugin. Therefore, I hope you are willing to further investigate
   and resolve this issue. It cannot be the intention that SiteGround users upload
   an image and certain image sizes get broken.
 *  Plugin Support [Georgi Ganchev](https://wordpress.org/support/users/georgiganchev/)
 * (@georgiganchev)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/problem-image-size-3/#post-15627377)
 * Hello [@remcotolsma](https://wordpress.org/support/users/remcotolsma/)
 * Our developers will check the case further and decide if there is something we
   can do to prevent image corruption.
 * Please be advised that the plugin works without any issues if there is no custom
   resolution change applied through the code that you provided us with. In addition,
   the case is observed only when the image that you upload is with this particular
   resolution of 600×360 and with a .jpg extension. If the image is with a .jpeg
   extension the problem doesn’t come up.
 * Best regards,
    Georgi Ganchev
 *  Plugin Support [Gergana Petrova](https://wordpress.org/support/users/gpetrova/)
 * (@gpetrova)
 * [4 years ago](https://wordpress.org/support/topic/problem-image-size-3/#post-15663181)
 * Hello [@remcotolsma](https://wordpress.org/support/users/remcotolsma/),
 * Our developers are currently working on a fix which should be included in one
   of the future releases of the plugin. While we cannot provide an ETA, we will
   update the topic, when the fix is released.
 * With that in mind, we will be marking this topic as Resolved.
 * You will still be able to post a reply, if needed.
 * Best Regards,
    Gergana Petrova
 *  Plugin Support [Gergana Petrova](https://wordpress.org/support/users/gpetrova/)
 * (@gpetrova)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/problem-image-size-3/#post-15759442)
 * Hello [@remcotolsma](https://wordpress.org/support/users/remcotolsma/),
 * A fix for the reported issue has been deployed and is available since version
   7.1.3, most recent version is 7.1.4. Please update the plugin to the latest version
   and test on your end as well.
 * Best Regards,
    Gergana Petrova
 *  Thread Starter [Remco Tolsma](https://wordpress.org/support/users/remcotolsma/)
 * (@remcotolsma)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/problem-image-size-3/#post-15773749)
 * Just tested this, seems to be resolved indeed, thanks for your efforts.

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘Problem image size’ is closed to new replies.

 * ![](https://ps.w.org/sg-cachepress/assets/icon-256x256.gif?rev=2971889)
 * [Speed Optimizer - The All-In-One Performance-Boosting Plugin](https://wordpress.org/plugins/sg-cachepress/)
 * [Support Threads](https://wordpress.org/support/plugin/sg-cachepress/)
 * [Active Topics](https://wordpress.org/support/plugin/sg-cachepress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/sg-cachepress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/sg-cachepress/reviews/)

## Tags

 * [corrupt](https://wordpress.org/support/topic-tag/corrupt/)
 * [image](https://wordpress.org/support/topic-tag/image/)
 * [size](https://wordpress.org/support/topic-tag/size/)
 * [thumbnail](https://wordpress.org/support/topic-tag/thumbnail/)

 * 10 replies
 * 5 participants
 * Last reply from: [Remco Tolsma](https://wordpress.org/support/users/remcotolsma/)
 * Last activity: [3 years, 11 months ago](https://wordpress.org/support/topic/problem-image-size-3/#post-15773749)
 * Status: resolved