clarkwinkelmann Thank you very much for the speedy response! I swear I'd tried clearing the cache but apparently not.
For my own purposes, I plan to make a few modifications (I don't know what I'm doing when it comes to Flarum extensions and currently have higher priorities):
- Keep a copy of the original file when resizing so that I can recompress later without generation loss. Today's post content is 760px wide but tomorrow's might not be. This could (implementing it is not a priority for myself) also be used as a means of serving a reduced-resolution version but allowing users to click through to the original version, which would be beneficial for instances such as when someone uploads a screenshot of their entire screen.
- Generate a WebP version of images, which gets served to compatible browsers. Maybe also a lower resolution for mobile/narrow devices. I'm aware avatars aren't WebP, but that's another matter since that's core stuff.
- Convert lossless to lossy when beneficial for filesize.
- Configure the compression. I've not yet investigated exactly what the extension does, but I'm quite picky about what I believe the best JPEG settings are, even down to the DCT method.
- Add a video preview template. If contributing to the public source code, I'd probably add one for audio while I'm at it. Ideally ffmpeg would kick in to generate a thumbnail and compress the video after upload if it meets some requirements (in my case 720p and up to 30 seconds). Only one video would be encoded at a time, and with a high niceness to reduce impact on website speed. The user would not have to wait for the video to be compressed - the original would be shown until the compressed version is ready.
- Replace
upl-image-preview
with the default image markup, or make it so there's actually some benefit to upl-image-preview
, such as referring to attachments by an ID instead of URL (I wouldn't sort out the latter idea myself because the current setup works and URLs can be rewritten).
- Improve the upload process with a progress bar and cancel button, and make it so the user can't send the post before the upload has completed. Somehow, this sounds trickiest.
Things I wouldn't implement myself but would like to see include:
- The ability to view all the attachments on the website, from the admin panel. This would make it easier to spot any problematic attachments.
- Automatic purging of files that get uploaded but not included in a post within 48 hours (doesn't matter exactly how long, as long as it's long enough to be confident the post has been abandoned).
- Different filesize limits for different types of uploads.
- User quotas.
I know waffling on about all this might seem a little pointless, but if there's anything straight-forward I've listed I'll work on (not ffmpeg, not progress bar), you (everyone) may be able to change the order I sort these things out (if I do sort them out) and benefit from getting a copy of my modifications.