How to manage Images and Thumbnails?
I wanna know how photos are managed 开发者_C百科on websites.
Ex: A user uploads a Photo.. say which is 1024 * 768..
I have differnt size thumb nails on the website.
- 60 * 60
- 30 * 30
- 120 * 90
- 240 * 180
Since all the above images are not of the same aspec ratio.
which is the best way to resize and crop images to suit my needs ?
Note: Images will contain food or restaurant images. i am not sure how to crop them not knowing the nature of the of image composition.
You can't auto-crop algorithmically which is why sites that need a certain aspect ratio ask the person uploading to manually crop the image.
Failing that, you'd need a person on the back-end doing the cropping for them.
Once you have the proper aspect, resizing is trivial.
you can't know what to crop, unless you're using some blob detection recognition algorithm, and detect what you want to remove, and what i just said is sarcasm, because ... forget about it.
so you're better off using resizing, and that's easy, just choose the ratio closest to the ratio of the image. and to choose between same ratios, depend on the image dimensions/quality
精彩评论