Page 1 of 1

resize image

Posted: Tue Dec 07, 2010 3:49 pm
by amirbwb
hello i have some images in my database and i want to display them, but i want to do :
if they have (w > 600 and/or h > 600)
{ resize the image to 50%}
if (not){ display normaly}

Re: resize image

Posted: Tue Dec 07, 2010 4:13 pm
by isset
Can't you just use width and height in <img src='' width=''...> ?

Do you already know the size of the images?
Otherwise you will have to check with gdlib and then you use your if-condition.
And you can resize the width/height to 50% by dividing $width/$height with 2 and then you put those values into your img-tag

Where ist the problem?