2

I'm building a file storage programme that will also display images in photo galleries to users who upload them. I was wondering if anybody could help me out.

My plan was if an image was wider than 500px then I would resize it to 500px (gallery and mobile use) width and 250px (thumbnail use) width

I have no serious experience with this so I was wondering if anybody could help me. How many different versions of a single image should I store and at what sizes. Thanks

asked Apr 25, 2013 at 21:30
1
  • 1
    It depends on what sizes you need them at. You store them at all the sizes you need them at. Disk space is cheap, especially for small files. -- Consider also programmers.stackexchange.com/questions/195388 Commented Apr 25, 2013 at 21:44

3 Answers 3

2
  • If you are using these images on your website, store them exactly in all different sizes you are going to use on your website.

  • Image Scaling is a very important factor in a website's performance, and saves bandwidth and page-load time.

  • Scale images in accordance to your need, as disk space doesn't costs much.

  • See what google has to say about image scaling https://developers.google.com/speed/docs/best-practices/payload#ScaleImages

answered Apr 25, 2013 at 21:56
3
  • 1
    Are there any articles or anything you have knowledge of so I could learn more Commented Apr 25, 2013 at 22:12
  • @kev670 there are mant blog posts out there (countless many) - what problems do you have that you want to learn more? Commented Apr 26, 2013 at 4:30
  • @kev670 see my edited answer Commented Apr 26, 2013 at 11:34
1

Consider resizing the image not on upload but on demand (and caching the results).

This has a bonus feature; whenever you encounter a new use case that requires a new size, you can generate it easily by changing the parameters in the new code. It won't require you to run computation on your entire set of images all at once before it works.

answered Apr 26, 2013 at 4:32
0

If you are doing this for a web site, and if you are using PHP, there are a set of library functions in PHP that will do this.

It's used for example as part of Wordpress - I expect you could download the source code and go poking around in there to see how its done. It's been years since I last looked in there so I can't be more specific.

answered Apr 26, 2013 at 1:45

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.