Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How did Google images normalize the width of each row?

It's easy to resize images so that they all have the same height while maintaining the aspect ratio, but how did they fit them all on a row such that every row has the same width? Did they crop some of the images or what?

like image 591
mpen Avatar asked Aug 07 '10 05:08

mpen


2 Answers

Remember in google images (apart from cropping) -

  1. Spacing between images are not always exactly same.
  2. Height of all images in a row are also not always same.

Using above 2 techniques i.e. tweaking the spaces between images and changing size of image little bit by compromising height you can achieve this. In fact the the justify paragraph option in the text editor also use the spacing technique. They evenly distribute the extra spacing between all word.

You don't always get a good spacing in google image search. See this -

alt text http://dailycoding.com/filesharing/Google_image_search.jpg

like image 174
Ramesh Soni Avatar answered Oct 18 '22 02:10

Ramesh Soni


they actually figure it out through an algorithm to put images next to eachother so with the padding and everything they end up being the same width then they cache that page for the keyword you searched for!

like image 2
Neo Avatar answered Oct 18 '22 04:10

Neo