LuminaWebsite/assets
Maaxxs 6e486b07ef Uploads: pictures no longer arrive black when the browser cannot shrink them (Firefox)
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>
2026-09-27 23:17:37 +02:00
..
css Members: ranks keep their tag in the rank view, also a group with its own section like Brigadegeneral 2026-09-27 22:40:27 +02:00
images New tab icon (Lumina Ascendens crest), homepage: 100+ active members 2026-09-22 01:44:17 +02:00
js Uploads: pictures no longer arrive black when the browser cannot shrink them (Firefox) 2026-09-27 23:17:37 +02:00
map Raidplaner: tactics on the maps of all dungeons and raids, with tokens that move from step to step 2026-09-26 12:45:00 +02:00
uploads Group icons: groups get an icon in front of their name, like the role icons in Discord 2026-09-25 12:35:02 +02:00