Error 500 when using old image in thumbnail size
-
This is quite the weird bug:
I have some old images on my website (500×500 px, from March 2022). They are already implemented on one page and working fine. But if I change their loading size to “thumbnail” and try to save that page, the server returns an error 500 and that page is FUBAR. Neither undo nor restoring previous revisions works. The page just cannot be saved any more and saving always returns code 500.
This applies to any and all pages, but only in conjunction with any of my old 500×500 px images. I re-uploaded one of these problematic images for testing. Using that image, the error does not occur and everything works as it should. The old and newly uploaded images are 100% identical regarding SHA-256 checksums. I even compared the resized versions, yielding the same result.Reloading the FUBAR page throws this error message:
Fatal error: Uncaught TypeError: Unsupported operand types: string * float in /my-website/app/public/wp-includes/media.php on line 467
That referred line of code is this:
$h = max( 1, (int) round( $current_height * $ratio ) );
Things I did for troubleshooting:
- Make sure you are using the most updated versions of Elementor, WordPress & your theme.
- Deactivate all of your plugins. If this solves the problem, gradually activate your plugins one by one, until you spot the problematic plugin. Only Elementor and Elementor Pro are active ATM
- If you have a caching plugin, make sure you deactivate it
- Change your WordPress theme to WordPress TwentyTwentyTwo.
How to reproduce:
create new page
add inner section
add an image to the inner section
change image size to thumbnail (150×150)
saveAs stated before, this only applies to my old images.
System info:
https://pastebin.com/KkxqNmcp
The topic ‘Error 500 when using old image in thumbnail size’ is closed to new replies.