Compress image before upload (Client side optimization)

Hi guys,

any idea how to implement with bricks form?

Or if you have any type of image compression on client side, which will be easier to implement with Bricks please feel free to share thanks :pray:

1 Like

Hi Martin,
The short answer is no, “image compression on client side” is not and will never be allowed by any mainstream browser as it would require that the web site have direct file, memory, and execution privileges on the client machine, which would effectively grant the web site complete control over the client operating system and negate all security.
Dropzone can’t do that either.

Every web browser which supports and has enabled javascript is able to resize and compress images using HTMLCanvasElement: toBlob() method - Web APIs | MDN on client side.

Dropzone works well. I also have my own basic script for resizing and scaling images. I can use my custom form which works OK. But would love to use Bricks form.

Just FIY you can take a look at which uses compression on client side as well.