Jump to content
xisto Community
Sign in to follow this  
Zeeshan Hashmi

Php :: Image Pixel Per Inch And Conversion Please Guide

Recommended Posts

Hi MastersI want soemone to let me know (maybe through a good tutorial and/or PHP Sample Code) the following :1 - User will only allowed to upload images with minimum 120 and maximum 300 Pixel Per Inches2 - User will only allowed to upload JPG images, however, if Gif / BMB / PNG / ETC is uploaded the script will convert that into jpg.3 - If the Image's PPI is > 300 it will set to 300. Please guide . I know this can'y be done by GD it requires ImageMagick, Pleae help !!!!!!!

Share this post


Link to post
Share on other sites

1 - User will only allowed to upload images with minimum 120 and maximum 300 Pixel Per Inches

2 - User will only allowed to upload JPG images, however, if Gif / BMB / PNG / ETC is uploaded the script

will convert that into jpg.

3 - If the Image's PPI is > 300 it will set to 300.

 

GD Library:

 

As your script uploads it, you make following:

resource imagecreatefromjpeg ( string filename );

//if it's not jpeg - there may be gif/png/etc

bool imagecopyresampled ( resource dst_image, resource src_image, int dst_x, int dst_y, int src_x, int src_y, int dst_w, int dst_h, int src_w, int src_h );

bool imagejpeg ( resource image [, string filename [, int quality]] );

 

Don't have time now, gonna write others a bit later.

Edited by CrazyPensil (see edit history)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.