I was getting this error message on two PNG images.
Suspect it was a timeout issue caused by another plugin EWWW Image Optimizer which optimizes images as they are created. So as the new thumbnails were created they were automatically optimized as well.
What I found was jpgs were running through both plugins no problem, but PNGs popped out the above error.
Disabling EWWW Image Optimizer while I regenerated images resulted in fast regen. After the regen turned the plugin back on and optimized, though was still having problems because it’s a process that takes time and it was timing out.
The optimizing plugin wasn’t the issue per se, it’s the time it takes to regen the thumbnails AND optimize at the same time. I had the optimization set high, with PNGs there’s levels and I had it set at 48 levels (quite high) and it was taking too long for my server settings. Most servers have PHP script timeout set to 30 seconds (Max Execution Time), if the script isn’t done in that time it times out. Usually I’d see a 500 error, but not in this case, no idea why.
On localhost tests I have execution time set to 60 minutes (sometime import large amounts of data), so the setup worked that wouldn’t work on a live server with a shorter PHP script execution time set. I’ve run this setup on thousands of images on localhost and it’s never failed.
Though I wouldn’t suggest setting Max Execution time to several minutes on a production site for long periods of time, you could try it to rule out timeouts and after regen set back to a lower value. You could also check you don’t have other plugins that do something to images as they are created that’s slowing the regen down.
David