Client side image optimization enabled by default

AI-generated summary

Discourse has enabled client-side image optimization by default. This feature, which uses Rust, WebAssembly, and MozJPEG, optimizes images in the browser before uploading them. Falco notes that site administrators can disable it using the composer media optimization image enabled site setting if necessary. However, disabling strip image metadata is not compatible with this feature, and will require disabling the image optimization to preserve EXIF data.

Due to iOS bugs, this feature has been disabled on iOS devices Falco and sam mention that it was causing regular crashes when handling large files. nobodyfrm inquired about the ETA for re-enabling this feature on iOS, but Falco clarified that it was only designed for still images, not videos. For users wanting to share large videos, Falco recommends using the Video Upload to YouTube and Vimeo using Theme Component.

We just enabled the the browser image optimization feature by default on Discourse.

You can learn more about how it work in our blog:

If necessary, a site administrator may disable it using the site setting composer media optimization image enabled.

This new feature is also not compatible with disabling strip image metadata. So you will want to disable this new feature if you want to preserve images EXIF.

Update Jan 2023 - we had to disable this on iOS due to iOS bugs.

23 Likes

4 posts were split to a new topic: PNG with transparency getting converted to JPG after uploads

Note, this is now disabled by default on iOS.

https://github.com/discourse/discourse/pull/19790

We were seeing regular crashes in iOS when large files are involved. Hopefully iOS is a bit better in 6 months or so, Apple need to catch up here.

4 Likes

We currently experience the problem that iOS users are unable to upload videos they recorded themselves with their mobile device because the file size is too high. Unfortunately, the users lack the technical affinity to know how to optimize the files themselves.

Do you already have an ETA as to when the client-side optimization on iOS is re-enabled by chance, or can we re-enable it ourselves?

1 Like

Our client-side image optimization feature never worked with videos, only still images. So, even if we were to re-enable it, I’m afraid that won’t help your users.

If your users want to share large videos, I’d recommend using Video Upload to YouTube and Vimeo using Theme Component instead.

2 Likes