Support » Plugin: ShortPixel Image Optimizer » WP 5.3 Scaling Big Images – Irrelevant with Shortpixel

  • With WP 5.3 a new feature saw the day of light: Big images are scaled down by WP:

    Introducing handling of big images in WordPress 5.3

    Very annoying the feature adds “-scaled” to the file name.

    I already use Shortpixel for scaling down large images – and I’d prefer to keep using Shortpixel for this job.

    I suppose most of your users would.
    So an idea for your plugin:
    If the site has the Shortpixel “Resize large images” option enabled, then Shortpixel plugin should automatically disable the WP core image scaling.

    It makes no sense to have a duplicate process for scaling images…

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Support Gerard Blanco

    (@sixaxis)

    Hi @loenne!

    I agree with you, it makes little sense to scale down twice the images. I will talk to our team and we will internally discuss how to proceed.

    Thanks for your suggestion!

    Sounds great, hope for a quick solution 🙂

    Did you find a solution to this? 🙂

    Plugin Support Gerard Blanco

    (@sixaxis)

    Hey @loenne!

    Sorry, no news and no ETA yet. But we didn’t forget about it!

    it is so easy:
    add_filter( 'big_image_size_threshold', '__return_false' );

    +1 on this feature

    I use your “Resize Large Image” function, which is set for 1924px / 1280px. Everything was fine until WP 5.3 came out with it’s new large image sizes and resizing.

    Now, when I (or I should rather say, my cliets) upload full-res image right from the camera, this happens:
    1. Your plugin replaces original image with 1924px reduction (so far so good…)
    But:
    2. 1536×1536 and 2048×2048 sizes are generated too, not needed and not wanted
    3. 1536×1536 and 2048×2048 sizes are shown in some of the selection lists, not wanted
    4. -scaled versions are generated too

    One of the main purposes of the Resize Image function is to reduce the space on the server (at least with the Image Backup off), but this new WP “feature” is causing addition of 3 more large image sizes (which are never used), thus basicaly tripling the data size.

    @darkpollo

    it is so easy:
    add_filter( ‘big_image_size_threshold’, ‘__return_false’ );

    Unfortunately, it’s not that easy. With this option, you disable only the scaling feature, but 2 new sizes (1536×1536 and 2048×2048) are still generated.

    As I mentioned in previous reply, my resize option is set to 1924px, so I definitely don’t want 2048px size, and 1536 is quite close to 1924, so I don’t need it too.

    So, ShortPixel devs, please when implementing this feature take into account this situation as well.

    This is the code I use to disable all new sizes completely:

    
    // disable generating new image sizes
    function bleye_disable_image_sizes($sizes) {
        unset($sizes['1536x1536']); // disable 2x medium-large size
        unset($sizes['2048x2048']); // disable 2x large size
        return $sizes;
    }
    add_action('intermediate_image_sizes_advanced', 'bleye_disable_image_sizes');
    
    // disable scaled image size
    add_filter('big_image_size_threshold', '__return_false');
    
    // remove new sizes from selectors
    function bleye_add_custom_sizes_to_admin( $sizes ) {
        unset($sizes['1536x1536']); // disable 2x medium-large size
        unset($sizes['2048x2048']); // disable 2x large size 
        return $sizes;
    }
    add_filter( 'image_size_names_choose', 'bleye_add_custom_sizes_to_admin' );
    

    @blackeye0013
    Your issue with sizes has nothing to do with the plugin, as this is by default on WordPress.
    The plugin already tells you to select which ones do you want to optimize.
    But this problem with sizes was already been there for other sizes for years, some came from themes or other places.
    I myself have disabled the medium_large 768px on all my installs (long time ago).
    https://developer.wordpress.org/reference/functions/remove_image_size/
    Instead of unset I suggest to use that code to remove the image size completely.

    It is impossible for the plugin to take care of all different sizes (and there are other plugins for this too), but they should implement the easy one, not sure why they have not done it yet, as this is a line of code.

    @darkpollo, thanks for a heads-up on remove_image_size. I’ve definitely done a bad job on researching the issue. I have to say, I was a bit suprised, it has to be done this unintuitive way, so I’m glad, there’s a more streamline way there.

    On the case wheather this issure is related to ShorPixel or not – well it depends.
    As I stated earlier, when you limit the image size on 1924px, you definitely don’t want WP to generate 2048px “thumbnail” for you. And since most of the users probably won’t have a clue this size even exists, they should be at least informed.

    But this feature should be definitely optional, not hidden and automatic.

    So, this issue has 2 parts:
    1. When you limit your image size, you probably don’t want WP to generate this large sizes for you. And it would be nice, if you could disable it within ShortPixel.
    2. Of course you don’t want ShorPixel to optimize those extra sizes for you, but you’re right, you can already disable this with the current version.

    Yeah, the problem is that most people that do not know about all this, they probably have not only that size but others (themes do this a lot, not sure why).

    And also, the code to disable it properly, will remove it from everywhere, including the admin on shortpixel, so it is complicated to add this into the same plugin, without affecting the rest of the functionality included on it.
    Can be done? yes.
    It is something that the developers will find it easy to implement? No.

    I prefer they keep the plugin for what it is, optimizing my images. I will tell the plugin and the WordPress which Images I want, the plugin just needs to optimize them the best way possible.

    Also, disabling defaults from WP should be made carefully, as you can affect other areas of the installation. If people do not know how to do it themselves, then, they should not do it until they learn what implications will have on the rest.

    So, what I would like, is to be able to disable the sizes within WordPress, and not using code. Again, out of Shortpixel area of influence. 🙂

    I hope they at least read all this and say something. 😀
    Have a nice day!

    Plugin Support Gerard Blanco

    (@sixaxis)

    Hi guys,

    I’ve passed the information to our developers.

    Thanks!

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