The exact same website, on a different cPanel server has no issues
We also have some issues when resizing images a different way. Here we use our own crop library (Cropper-4-1-0). Here the cropped image is saved back to the server via base64, and the file is saved but corupted (data seem to be saved only half).
We aren’t seeing any faults in cPanel, we don’t appear to be running out of memory (that has been set high)
I’ve spent some time with Michael trying to work this out, and it’s very strange.
There’s no Concrete errors logged, no server errors.
We had a theory at one point at that /tmp was full, but we confirmed that was the case. The fact it does it with both GD and ImageMagick makes me think there’s some sort of fault in a system library, something that reads images…
The company we have leased the hosting server from convinced me to switch from Apache to Litespeed server. And now everything works as it should again.
I have to say that server support is thoroughly incompetent. The excuse was that they didn’t know much about Apache. And I’m in a situation where we can’t just change server hosting company.
I would like to thank everyone here for offering help and comments.