Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => Images

Any thoughts?

images php coding issues or problems here.

Moderators: macek, egami, gesf

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?
Jemshope
New php-forum User
New php-forum User
 
Posts: 1
Joined: Thu Jan 12, 2012 2:27 am

Re: Any thoughts?

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

Hi,

You can use the function getimagesize()

Code: Select all
<pre>
<?php
$img_info = getimagesize("my_image.jpg");

print_r($img_info);
?>
</pre>


this is cool....

more info: http://php.net/manual/en/function.getimagesize.php
jorgepinho
New php-forum User
New php-forum User
 
Posts: 101
Joined: Tue Jul 05, 2011 5:41 am
Location: Portugal

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
http://help.adobe.com/en_US/PhotoshopElements/7.0_Win/WSae2ea3b149d0c3591ae939f103860b3d59-7ee8.html
moonlight
New php-forum User
New php-forum User
 
Posts: 1
Joined: Fri Jan 13, 2012 11:16 pm


Return to PHP coding => Images

Who is online

Users browsing this forum: No registered users and 0 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.