flushedpancake
Senior Member   
Posts: 174
Registered: 4-1-2024 Location: England
Member Is Offline
Mood: Fine, I suppose
|
|
How to handle HEIC
I noticed one of the recent commits that properly defines image formats. This is a good thing (though bitmaps don't tend to be parsed as
embeddable in <img> tags, if I'm not mistaken, could be wrong though)
We should probably be converting HEIC to WebP or AVIF, instead of rejecting the format entirely. iOS tends to be extremely schizo about what format to
save a photo in for some whatever reason - sometimes it'll convert stuff saved in Safari to JPEG/HEIC/PNG, sometimes it won't, sometimes
it'll save photos as JPG, sometimes as HEIC, and there doesn't seem to be any real consistent variable, it's almost entirely random and
can't seem to be disabled.
(A problem with Safari that has been around since the original iPhone and is still a problem to this very day, unless you like saving random stuff in
the Files app.)
Working around Apple's insistence on not following standards really does give off similar vibes to a certain web browser, doesn't it?
Website
Only takes one tree, to make a thousand matches, only takes one match, to burn a thousand trees...
|
|
|
miqrogroove
|
|
Web browsers have BMP support. That's never been a problem.
The GD library doesn't support HEIC so uploading that format to XMB will be treated as a downloadable attachment with no thumbnail.
|
|
|
miqrogroove
|
|
Other possible solutions:
- Try to find PHP support for this. It is not included by default, even with better extensions such as gmagick. This is messy and won't work in
many environments.
- Provide a separate "Image upload" field with an explicit accept attribute. This forces
devices to either convert or exclude unsupported formats. Creates a busy user experience, but I've seen it done in some projects.
- Leave it the way it is. HEIC files are downloadable with no thumbnail.
|
|
|
flushedpancake
Senior Member   
Posts: 174
Registered: 4-1-2024 Location: England
Member Is Offline
Mood: Fine, I suppose
|
|
The second idea could be implemented as a future plugin, perhaps with some extra options. Honestly, posting images in general is somehow one of those
things that manages to be quite fumblesome, just because of the fact it doesn't auto-scale huge images not to stretch the screen off the page
when you link them through URL.
That said, maybe it would actually be worth considering limiting the file types actually allowed to be uploaded to the board in the first place, since
apparently you can upload exe files: (testing with CMD from Windows XP SP2 x64)
Attachment: cmd.exe (380kB) This file has been downloaded 6 times
We could leave it as it is but maybe do what we do with the avatar upload check, but instead, check specifically for HEIC and throw up a
warning that there'll be no thumbnail or in-browser preview if the user selects a HEIC/HEIF file...
Website
Only takes one tree, to make a thousand matches, only takes one match, to burn a thousand trees...
|
|
|
miqrogroove
|
|
Should be core functionality, not a plugin. Configuration details will be less important so maybe plugins could do some of that. But in the
meantime, yes it could use an on/off switch at most.
|
|
|
miqrogroove
|
|
Even my desktop photo editor can't open HEIC files. Not really sure about the next steps yet. Maybe Microsoft Paint doodles can be used for
testing. 
|
|
|
flushedpancake
Senior Member   
Posts: 174
Registered: 4-1-2024 Location: England
Member Is Offline
Mood: Fine, I suppose
|
|
I will take any opportunity possible to post random nonsense
This is now your fault
Website
Only takes one tree, to make a thousand matches, only takes one match, to burn a thousand trees...
|
|
|