0

I've been searching everywhere without luck.

A simple way to reduce the width of an image picked with a simple <input type="file" /> without it losing it's aspect ratio.

I am using jquery to select the image before uploading like so: $('#image')[0] but I need a way to reduce the image width before uploading to reduce the file size and data being sent to the server and of course received when users download the image when visiting the website.

Johhan Santana
  • 2,336
  • 5
  • 33
  • 61
  • Possible duplicate of http://stackoverflow.com/questions/2434458/image-resizing-client-side-with-javascript-before-upload-to-the-server – webdeb Feb 13 '17 at 02:19
  • "I've been searching everywhere without luck." - whats wrong with the link above? – webdeb Feb 13 '17 at 02:22
  • I kind off was looking for a plugin like https://github.com/danialfarid/ng-file-upload not something I had to code but if that's the only way I guess I'll have to. – Johhan Santana Feb 13 '17 at 02:26
  • This site is explicitly built for "how do I code this", not "how do I find a plugin for this". – Daniel Beck Aug 17 '22 at 13:13

1 Answers1

-1

If you still need it you can use this library. It worked for me, because it lets you resize width, height and file size, obviously with a image quality loss. Compress.js library

Miguel
  • 1
  • 1
  • 3