Any thoughts?

images php coding issues or problems here.

Moderators: macek, egami, gesf

New php-forum User
New php-forum User
Posts: 1
Joined: Thu Jan 12, 2012 2:27 am

Any thoughts?

Postby Jemshope » Thu Jan 12, 2012 2:44 am

I have a simple image uploader - that makes a thumbnail - and resizes the original image if it is too large. My problem is that even though the program works - and resizes the original image - I don't want the image to be resized if it is SMALLER than the max width/height of 400 pixels. How would I write an if/then statement in there that would only resize the original if it was LARGER than 400/400? Because now - it resizes even tiny images to 400/400 pixels, and they come out really blurry when they are displayed. Any thoughts?

New php-forum User
New php-forum User
Posts: 101
Joined: Tue Jul 05, 2011 5:41 am
Location: Portugal

Re: Any thoughts?

Postby jorgepinho » Thu Jan 12, 2012 3:15 am


You can use the function getimagesize()

Code: Select all

$img_info = getimagesize("my_image.jpg");


this is cool....

more info:

New php-forum User
New php-forum User
Posts: 1
Joined: Fri Jan 13, 2012 11:16 pm

Re: Any thoughts?

Postby moonlight » Fri Jan 13, 2012 11:25 pm

The image size (or pixel dimensions) of an image is a measure of the number of pixels along an image’s width and height. For example, your digital camera may take a photo that is 3000 pixels wide and 2000 pixels high. These two measurements have a direct correlation to the image’s file size, and both are an indication of the amount of image data in a photo.

Resolution is the fineness of detail you can see in an image. It is measured in pixels per inch (ppi). The more pixels per inch, the greater the resolution. Generally, the higher the resolution of your image, the better the printed image quality.
boar hunting
more detail visit

Return to “PHP coding => Images”

Who is online

Users browsing this forum: No registered users and 3 guests