• benntech

    (@benntech)


    Since I know WP 5.6 is going to break my existing theme, I have been searching for new themes and plugins. I don’t know what triggered it, but for some reason that asinine “-scaled” image downsizing has been applied RETROACTIVELY TO ALL MY EXISTING IMAGES. Not new uploads, but existing images.

    I want to reiterate: THIS NOT FOR NEW UPLOADS. The “-scaled” resizing has been applied to EXISTING images.

    Yes, I already know about putting
    add_filter( 'big_image_size_threshold', '__return_false' );
    in my functions.php. That is already there. It is working because new images are not getting scaled. However, it wasn’t in place for the new themes that I was testing. (Did you think of that WP developers? I have to create a child theme for every theme I try just to disable this “feature”?)

    Now when I try to add media to a page, I only can only select the scaled images, which means now the images for my full-page photography website are pixelated crap.

    Why did my EXISTING images get scaled? More importantly, how do I restore access to my original full-size images without the -scaled suffix?

    Also, I have to vent about this “feature”. I have been a programmer for nearly 40 years. I’m also a semi-professional photographer. When I’m trying to showcase my work, I don’t need WP forcing downscaled pixelated crap on me. This should have been implemented as an OPT-IN setting in the Dashboard. Instead, you FORCE this upon everyone, and the only way to disable it is by adding code to a theme? As a programmer, this is an inconvenience to me. But what about all the regular WP users who are NOT programmers? You seriously want them modifying theme code? Furthermore, every person person who wants this off has to remember to re-add that line EVERY time the theme updates. Or you’re forcing everyone to create a child-theme for every theme we use just to disable this “feature”. Furthermore, I can guarantee you that almost no one will remember the exact filter name and all the proper underscores, so every time we update a theme or create a child theme, we have to Google how to disable this and spend several minutes digging through blog posts to find this one line of code. EVERY TIME. I’m not going to mince words here–this is absolutely the WORSE design ever and whoever designed it this way is a total f*ing moron. Seriously. You f*d so many users with your asinine design. Hopefully you can redeem yourself by changing this to a Dashboard toggle really soon so every person who wants to disable this “feature” doesn’t have to go through all the headaches that I just described.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Joy

    (@joyously)

    As a programmer, you should be aware that it’s best to put code in a plugin, either one you write or one you find, and in this case perhaps a mu-plugin would be best.

    Since I know WP 5.6 is going to break my existing theme

    Why would it? Wouldn’t it be easier to simply make your theme compatible with whatever is going to break?

    You can always stay on a version of WP lower than 5.3. It’s easy with WP Downgrade.
    It might not apply, but I would be remiss if I didn’t mention that there is a version of WP that doesn’t have the big image handling in it: ClassicPress, which was forked off of WP 4.9.

    Thread Starter benntech

    (@benntech)

    Thanks for your reply, Joy. However, it doesn’t help me at all. In fact, are you seriously suggesting that rather than insert a single line of code in my child theme that I should write an entire plugin just to disable this feature? Wow. I have to question if you understand themes at all. What do you think the purpose of a theme’s functions.php file is? WordPress themes literally require lines of code to work.

    Regardless, there is already a plugin to disable this “feature” (https://www.ads-software.com/plugins/disable-big-image-threshold/) with currently 10,000+ active installs. That means there are at least other 10,000 websites that didn’t want this moronic feature, and that number doesn’t include all of us who implemented it as a single line of code IN OUR THEME. Even if everyone affected by this spent only 10 minutes researching and fixing this problem, that’s literally thousands of manhours wasted on this issue, costing businesses tens of thousands of dollars. Shouldn’t you–and frankly everyone–be advocating that this “feature” be implemented as a toggle in the Dashboard? That could drastically reduce the time and money wasted on this issue. BTW, in my case, neither the line of code nor plugin fix my issue and restore my old images and proper names.

    For those of you like me who have been screwed by this “feature”, the only solution I have found so far is to manually restore all my downscaled images, after working all night, I am about halfway through my restore of hundreds of photos. Here is the process I am using:

    1. Install and activate “Enable Media Replace” plugin (https://www.ads-software.com/plugins/enable-media-replace/). This will allow you to replace the image and restore the original name without losing any customized attributes like title, description, etc.
    2. Get direct access to your /wp-content/uploads folder. For most hosted websites, this is usually via FTP.
    3. Find an image that this “feature” f*d up, e.g., MyBigImage-scaled.jpg.
    4. Download the ORIGINAL image, e.g., MyBigImage.jpg from your /wp-content/uploads folder. This saves you the trouble tracking down that original image that you uploaded days/months/years ago.
    5. Delete ALL versions of the image in /wp-content/uploads, e.g., MyBigImage.jpg, MyBigImage-scaled.jpg, MyBigImage-300×300.jpg, MyBigImage-scaled-300×300.jpg. WARNING: If you fail to remove the existing files, the replacement image will have “-1” appended to its name, which will break all your existing links to the image! (Also, instead of deleting, I personally moved the files to a temporary directory just in case.)
    6. Go to Media Library and the Attachment Details for the crappily downscaled image, then click the “Upload a new file” button (created by the above plugin).
    7. Click “Choose File” and select the full-scale image you downloaded above, e.g., MyBigImage.jpg. Note that the first line should read NOTE: You are about to replace the media file "MyBigImage-scaled.jpg". There is no undo. Think about it!
    8. Under Replacement Options, select “Replace the file, use new file name and update all links”. For Date Options, your choice, but I select “Keep the date”. Note that “update all links” doesn’t find everything and is especially lacking when the image has been used in 3rd party sliders or theme builders like Elementor, so if you did link to a “-scaled” image, you’ll need to manually track down all the broken links. Have fun with that.
    9. Click “Upload” and wait.
    10. Repeat starting at step 3 for all f*d up images.

    Now, as for 5.6 breaking my theme, I created a child theme from an Imagely theme based on the Genesis framework. I just happened across this video https://www.youtube.com/watch?v=FLM1kjJobbk. Fast forward to 1 minute mark. Apparently WordPress 5.6 is implementing a huge JQuery change that is going to break all Imagely themes and presumably all themes based on the Genesis framework. I can only assume there are countless other themes and plugins that are going to break as well.

    Joy

    (@joyously)

    In fact, are you seriously suggesting that rather than insert a single line of code in my child theme that I should write an entire plugin just to disable this feature? Wow. I have to question if you understand themes at all. What do you think the purpose of a theme’s functions.php file is?

    Yes, I am suggesting that you use a plugin instead of code in the theme. You don’t have to write the plugin, but it is better that it is in a plugin than a theme for these reasons:
    1) it’s independent of the theme switch
    2) it can be put into mu-plugins folder
    3) it can be used network-wide in a multisite installation
    4) plugins are loaded before the theme and so if anything is triggered on ‘plugins_loaded’ hook, it wouldn’t have been executed yet in the theme.

    Also, writing a plugin doesn’t take much — see Hello Dolly for an example.
    And yes, I do understand themes quite well, reviewing hundreds of themes, and have written parts of the Theme Handbook.
    I think the purpose of the theme’s functions.php file is to load the theme’s functions, and nothing else.

    That means there are at least other 10,000 websites that didn’t want this moronic feature, and that number doesn’t include all of us who implemented it as a single line of code IN OUR THEME.

    Those users would not have the problem that those of you that put it in the theme have, since it would always be active and so switching themes doesn’t affect the filter. There are 11 million users with a certain SEO plugin, but that functionality is not being put into core.

    Apparently WordPress 5.6 is implementing a huge JQuery change that is going to break all Imagely themes and presumably all themes based on the Genesis framework.

    Yes, the long-awaited update to jQuery 3.x is finally happening. Developers have been clamoring for this for years. It is only a problem for plugins or themes that use the deprecated functions. Most code should work just fine. There are fairly easy fixes for old code to work with the newer jQuery. See this page by the WP Support lead:
    https://clorith.net/updating-jquery-code-in-your-unmaintained-wordpress-plugin-or-theme/

    For your main concern of the images changing retroactively, I think that is not what happened. Without the filter, WordPress is creating a -scaled version of the big image, according to the threshold. The original image retains its original name, but the -scaled name is put into the database. This means that when you look at it in the Media Library, it is inaccurate, giving the original dimensions with the -scaled name. When the srcset and sizes attributes are computed (dynamically on the front end), the -scaled name is what is used, and smaller versions are created from that instead of from the original. This would only happen with images that you chose while the filter was not active. So if you had the filter and then didn’t, you will have two sets of smaller sizes of the image. And when you attempt to choose an image in the editor, it returns the -scaled name as the max. There is no access to the original image. Even using Regenerate Thumbnails plugin on it gets the -scaled name instead of the original name.
    I think if you explain the consequences of how this is actually working on a core ticket, you could get it fixed. https://core.trac.www.ads-software.com/
    I think there are other tickets already on this, but you need to search. Be aware that the main developer on this is leading the charge to remove the Media Size options. Here is the big image ticket: https://core.trac.www.ads-software.com/ticket/47873#comment:6 (the comment for saving the original name).

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘-scaled applied RETROACTIVELY to existing images’ is closed to new replies.