Asked for: a member's 4K screenshot (7.8 MB) arrived as a black picture in the gallery and as portrait - with Firefox;
the same file worked for others.
- assets/js/image-resize.js: the shrunken picture is checked before sending. The canvas is tested for readback first
(fingerprinting protection returns placeholders), the result is sampled, and the encoded blob is decoded again. An
empty, invisible or single-colour result gets a second try via WebGL, otherwise the original goes to the server,
which shrinks it itself. The old code sent a 12 KB black JPEG in these cases.
- Transparent pictures stay PNG (as JPEG the transparent parts turned black). A broken alpha channel (almost all
transparent, but a whole picture underneath - some games save screenshots like that) is read without the alpha
channel through WebGL, since a 2D canvas loses the colours at transparent spots.
- includes/functions.php: store_uploaded_image() makes pictures with a broken alpha channel opaque before resampling
(image_alpha_is_broken(), GD colorize with alpha -127) and, with $rejectBlank, refuses completely black or
invisible pictures with a hint to try another browser (image_is_blank()); profile_store_upload() uses it for
gallery, portraits, character pictures, backgrounds and premade banners.
- "Das Bild ist zu groß" names the webspace limit (upload_max_filesize, php_ini_bytes()).
- Patch note and README.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>