Best Practice for Images : Generating Thumbs or Resizing on the Fly |
[eluser]shoelessone[/eluser]
In that case (and again, maybe I'm misunderstanding something), could you use something like this http://staff.osuosl.org/~rob/jquery.scale/index.htm ? It's basically a jQuery plugin that will automatically resize an image to fit inside of it's container. Or possibly even easier/cleaner, write a bit of JS that does something like if thumb.height>thumb.width then set the medium.height=whatever you specify else set medium.width = whatever you specify (in other words, if it's a landscape image then constrain the width, if it's portrait constrain the height). I'm guessing there might be a better way to do this (I'm guessing the suedo code won't work ) EDIT: for the record, I think that making a medium thumbnail is very likely the best solution though, because obviously if somebody doesn't have JS enabled then your page won't degrade very well if JS is required to resize the image. I'm sure you could make it degrade fairly well (or do what I do and just hope everybody has JS ), but if you can spare the cpu cycles and space, the medium thumbnail might be the safest/easiest way to do this. |
Welcome Guest, Not a member yet? Register Sign In |