PDA

View Full Version : aspect ratios on an image.


Baleric
08-21-2006, 07:28 AM
hey guys, im trying to place images on a page (thumbnails) and gettnig the image name from a database, but i dont know how to shrink the image and keep the image aspect ratio. at the moment im using dreamweaver and using the image place holder tool, is it possible to keep aspect ratios on an image when shrinking it?

cheers

baleric

don_ankor
08-21-2006, 12:45 PM
why don't you store height and width of the image along with it in the database
that way you can fix aspect ratio of every image

Baleric
08-22-2006, 12:38 AM
how would i get the image ratios?
im using the freeaspupload script and have no idea, isnt there a way to keep apect ratios?

don_ankor
08-22-2006, 08:26 AM
oh you mean you're uploading it,storing just the name in the database, and then
insertin it into the web page r8.
i guess then you must search for some asp code that can give you image coordinates while uploading or somethin like its properties or so before writing it to disk.

Or
you're saving the image in some folder on your server's hard disk r8,
then i guess if you can get its width and height in the Advanced summary tag, there must be a way where you can do it with code (ie. get file Advanced summary info).
but i really dunno about that, if i ran into somethin i'll tell ya aight

Regards

Baleric
08-23-2006, 12:12 AM
cheers mate,

anyone know how to do it? or point me in the right direction?

don_ankor
08-23-2006, 04:46 PM
yo wut up,

i think you could find something in this url

http://www.4guysfromrolla.com/webtech/050300-1.shtml

voila

Baleric
08-24-2006, 01:02 AM
thanks dom, im still running into problems but im sure ill figure it out,
im trying to make the details show up from each image in the database as it is brought out,
so instead of using 'getfolder' that the script uses, i have to use getfile i assume.
ill look into it a little more.

thanks alot for the help mate

cheers

Baleric
08-24-2006, 01:13 AM
i have a variable that determines the mappath of the images, but the thing is it needs to be in quotes and i dont know how to do this i only know the single quotes.

("'" & var & "'") wich returns ' var '
when i need to return this
" var "

can someeone guide me please

Wylie
08-24-2006, 01:47 AM
I think you can try to replace " to "
However, I am not sure it worked or not.

Baleric
08-24-2006, 01:51 AM
hello wylie, i just got it working :) the funny thing is i didnt need any quotes,

now i just got to work somehting out so that i devide the image dimensions,
i need to devide them by 2 and if they are still bigger then 170 x 170 then i got to devide them by 3 and so on.
something like this.

if width < 170 then
width = width /2
then if it is still bigger
width = width / 3
and so on

then ill get what width has been devided by and use the same number on height.


does anyone know how to acheive this?