resize image

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
amirbwb
Forum Commoner
Posts: 89
Joined: Sat Oct 30, 2010 6:10 pm

resize image

Post 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}
isset
Forum Newbie
Posts: 4
Joined: Tue Dec 07, 2010 3:12 pm

Re: resize image

Post 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?
Post Reply