1

Is there a way to resize images client side before upload (when the user clicks the upload button) so that all fields with data-type="image" will execute resizing to the specified dimensions and then commit the upload?

I'm working on a mobile compatible app where users have often to upload images using their mobile camera. It's necessary to reduce the image on client-side to perform quicker uploads of the photos to the server to reduce upload time.

Thanks.

dda
  • 6,030
  • 2
  • 25
  • 34
Leo Fabiani
  • 19
  • 1
  • 2
  • 3
    Possible duplicate of [HTML5 Pre-resize images before uploading](https://stackoverflow.com/questions/10333971/html5-pre-resize-images-before-uploading) – Leandro Rodrigues May 22 '17 at 14:32

1 Answers1

0

There is a way to do this with plan JS by using canvas capabilities of HTML5.

Refere to this answer: JavaScript reduce the size and quality of image with based64 encoded code

Mario Petrovic
  • 7,500
  • 14
  • 42
  • 62