Was that given a go?
Another example of what is possible on ImageOptimization in browser:
This video goes over the tech. They compiled the state of art codecs (the same we use on the server for Discourse) to WASM 
Looks like a cool, optional thing for Discourse.
The WASM for mozjpeg can be compressed to 48k and the WASM for OptiPNG is 93k.
My image folder grows to 42.3 GB.
So I think I need to figure out image processing and storing in Discourse ![]()
I’m not sure if this is the right topic to post on, but I am very interested in knowing if there’s a way to automatically downsize images before they get stored in my discourse. My community is going to be very image heavy.
I’m less than a week in and already 350 MB used and not even open to general public yet. Would like to be able to resize images down to some resolution so that I keep them < 1MB or something like that (based on image resolution though as per norm I think).
I’d recommend using Digital Ocean spaces or S3 for your images so you don’t need to worry about space so much.
It seems unlikely that a community that really likes images is going to want really bad ones. 
We already have max_image_megapixels site setting, can you try toning that down?
@sam Yes, but, the problem is there’s a big difference between reducing some resolution that most people won’t even notice (IMO big diminishing returns), versus blocking them from uploading at all. On my main site, I downsize to 1500x and no one cares. But if they can’t upload it’s a huge hassle.
@pfaffman This sounds perfect, I guess I need to read:
I wonder, this is probably something I need to do sooner than later, because I’m guessing trying to migrate the files from discourse hosting to s3 could be hard?
I do support a simpler mechanism longer term, something like
All images must be smaller than 500k but allow people to upload stuff up to 2000k and fix on server if needed by either downsizing or reducing resolution. Try resizing on client first if possible.
But yeah, getting to this level of fidelity will take quite a while.
There is a rake task that will do it, but I’d say that sooner is better than later. ![]()
La mayoría de nuestros usuarios utilizan datos móviles y, a veces, su velocidad de internet puede ser de 3G o inferior. En muchas ocasiones, la calidad de las imágenes que envían no es lo más importante; para ellos, la velocidad es más prioritaria.
En una subida a 3G (aproximadamente 2 Mbps), enviar una imagen de 5 MB tarda unos 20 segundos, y este tiempo puede ser mucho mayor a medida que la velocidad disminuye.
Como señala @Falco, con algoritmos similares, el tamaño de una imagen de 5 MB puede reducirse a 190 KB comprimiéndola del lado del cliente y disminuyendo sus dimensiones. De esta manera, tanto el envío es más rápido (en 3G, aproximadamente 1 segundo) como se requieren menos recursos.
¿Existe tal característica en la hoja de ruta? Si la respuesta es afirmativa, ¿está lejos o cerca?
Es algo que queremos hacer eventualmente, pero no está en nuestra hoja de ruta pública en #releases.
Escribiré un RFC sobre esta función esta semana para que podamos avanzar con ella, al menos en lo que respecta a la especificación.
Esto ya es posible en iOS. Así (publicaré una captura de pantalla, espere un momento)
A través de
Seleccioné “grande”. ¡Aun así, la orientación se desajusta!
Gracias, eso es genial
![]()
Ojalá Android también aprenda ![]()
Además de esta función, lightbox puede ser un botón de rotación de imagen
Esta biblioteca parece interesante: GitHub - silvia-odwyer/photon: ⚡ Rust/WebAssembly image processing library · GitHub
Un binario wasm parece la opción ideal porque será rápido y eficiente en el uso de memoria.
Me pregunto si la compresión de imágenes del lado del cliente, cuando es posible, tendría un impacto notable en el rendimiento del servidor web con alojamiento de especificaciones bajas (por ejemplo, una instancia DigitalOcean con CPU compartida).
He observado picos ocasionales en el uso de la CPU que creo que están relacionados con las imágenes que los usuarios suben y que necesitan ser comprimidas. ¿Alguien ha visto un impacto similar?
Discutiendo la implementación en Optional image optimization before upload


