1

On my small webapp, I'm pulling lots of image urls in order to create a large gallery. However, most of these photos have very large resolutions and this leads to a very slow webpage. Are there ways for me to optimize/lower the resolution on the photos?

xheyhenry
  • 939
  • 1
  • 12
  • 22

1 Answers1

1

There are basically two ways to do this:

  1. Let the user upload the images to your server, which would then compress them before storing. How you do this depends on the technologies used on your backend. The only disadvantage is that the user will have to upload the full size image to your server, but that's not related to the problem you're trying to solve.

  2. Compress the images using JavaScript in the browser. This relies on several HTML5 technologies meaning it may not be supported in all the major browsers, especially older versions. If you're still determined to use this approach, this library may help.

Community
  • 1
  • 1
fstanis
  • 4,719
  • 1
  • 17
  • 37
  • Thank you - I'll take a look at #2. I don't think option 1 will work because my site is basically a reddit bot that just pulls in top posts every day or so, so I'm not actually storing anything but text information. Thank you for your help! – xheyhenry Sep 01 '15 at 22:13