Forum Moderators: coopster

Message Too Old, No Replies

Image sizes

         

bleak26

2:07 pm on Aug 24, 2006 (gmt 0)

10+ Year Member



I display a selection of resized images on my home page, some images are portrait and others landscape. I would like to only display the portrait images. I could use GD to assess each image for height and width but that seems like alot of work for every page load. Instead of doing it each time I could save that information to a database and only retrieve those that are portrait but this seems like alot of work to get information that i believe must be acessable more easily through another fasion.
Can anyone tell me wot that fasion might be?

adb64

2:24 pm on Aug 24, 2006 (gmt 0)

10+ Year Member



Few options possible:

1: Delete all landscape images
2: Make two directories, images/landscape/ and images/portrait/ and put each image in the correct directory
3: Make two textfiles e.g. portrait.txt and landscape.txt each containing per line the name of a portrait / landscape image. When a new image is added, check it's aspect ratio and append its name to the right file. When displayed, read the contents of the textfile and display the images named in the textfile.
4: I.s.o. using textfiles create two tables in your DB and add each imagefilename to the right table.

the_nerd

6:24 pm on Aug 24, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



5. add __l to every landscape filename and __h to every hor.