Sizing the dynamic images

images php coding issues or problems here.

Moderators: macek, egami, gesf

rajankkaran
New php-forum User
New php-forum User
Posts: 2
Joined: Thu May 10, 2012 5:57 am

Sizing the dynamic images

Postby rajankkaran » Thu May 10, 2012 6:03 am

Hi,

I am new to PHP.

I am working on online HTML to PDF conversion work. An end user can upload the image to the form and the form can be save as a PDF version.

The problem is, I have used the css (max-width:500px) for images which in browser it looks good but while I am converting to PDF, it is not working.

So I would like to size the images, If the image size is less than 250, it will be 250 else it will be 500.

Anyone can you please help me on this.

Thanks in advance

Regards,
Rajan.

User avatar
Nullsig
php-forum Fan User
php-forum Fan User
Posts: 981
Joined: Thu Feb 17, 2011 6:52 am
Location: Racine, WI

Re: Sizing the dynamic images

Postby Nullsig » Thu May 10, 2012 6:07 am

The most important question here is, what types of images are you accepting?

Are you going to accept just JPEGs? Or do you want to accept the big 4 (bmp,jpg,png,gif)? Do you want do deal with even more types than that?

rajankkaran
New php-forum User
New php-forum User
Posts: 2
Joined: Thu May 10, 2012 5:57 am

Re: Sizing the dynamic images

Postby rajankkaran » Fri May 11, 2012 12:43 am

Hi Nullsig, thank you for your reply.

I am going to accept only jpeg and png formats.

User avatar
Nullsig
php-forum Fan User
php-forum Fan User
Posts: 981
Joined: Thu Feb 17, 2011 6:52 am
Location: Racine, WI

Re: Sizing the dynamic images

Postby Nullsig » Fri May 11, 2012 6:37 am

There is a way to do this in PHP without assisted libraries but its easier to use the SimpleImages package.

It allows you to easily resize a variety of formats to any size, and still maintain aspect ratio.

http://www.white-hat-web-design.co.uk/blog/resizing-images-with-php/


Return to “PHP coding => Images”

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest

cron