#2052 - Formal implementation for cleanup of uploaded images
0 guests and 0 members have recently viewed this.
The top 3 point earners from 7th Dec 2025 to 14th Dec 2025.
| PDStig |
|
|
|---|---|---|
| Gabri |
|
|
| Master Rat |
|
|
There are no events at this time
It also won't be called if the image doesn't exceed the maximum size.
https://developer.mozilla.org/en-US/docs/Web/CSS/image-orientation
https://www.w3.org/Bugs/Public/show_bug.cgi?id=25508#c27
https://bugs.chromium.org/p/chromium/issues/detail?id=158753
Firefox has implemented, nobody else has. Chrome is arguing it is standardised badly, and possibly pushing to make it default to on and possibly make it controlled via an HTML attribute.
I think the only non-websafe formats we don't currently support are:
- BMP
- TIFF
BMP will be supported in v11, as it was added to PHP recently (for PHP builds that support it). It's not very important though as MS Paint has used .png as the default file type since at least Windows 7.
TIFF is not web-safe, and not supported by GD. And it is used widely in cameras. It would be nice to be able to auto-convert that.
I don't think any people are going to casually upload PSD files and expect them to display.
Gamma shows worse in:
- All versions of Safari (up to Safari 11.1, the latest)
- IE9 and lower
Firefox, Chrome, and IE10+ seem generally consisten with each other.
I don't think they ignore gamma, but they interpret it differently (cumulative vs ignore vs override?). It's hard to say what is correct.
There are 2 issues:
1) Inconsistency between browsers
2) Inconsistency between CSS colours and image colours, which are meant to be in the same colour space
There's a good test image in:
https://superuser.com/questions/579216/why-does-this-png-image-display-differently-in-chrome-firefox-than-in-safari-a
On Mac, Preview shows the same as Safari. Pixelmator shows the same as Firefox/Chrome/IE10+.
The best solution is to just strip gamma, as it's unlikely we even care about the system gamma saved into an image.
Just opening and resaving the image in PHP/GD effectively strips the gamma:
$img = imagecreatefrompng('VhGrd.png');
imagepng($img, 'VhGrd3.png');
1) support other uploaded formats and convert via Imagemagik (bmp, tif/tiff)
2) optipng heavy compression for PNG files
I don't actually care about these things, and they'd add a fair amount of extra work.