Is there a function in php which will determine the dimensions of an image and store them in variables?
Image Dimensions
Started by BlazeForc3, Jan 11 2006 02:27 AM
3 replies to this topic
#1
Posted 11 January 2006 - 02:27 AM
#2
Posted 11 January 2006 - 05:35 AM
try something like this?
<?php
function image_mirror ($input_image_resource)
{
$width = imagesx ( $input_image_resource );
$height = imagesy ( $input_image_resource );
$output_image_resource = imagecreatetruecolor ( $width, $height );
$y = 1;
while ( $y < $height )
{
for ( $i = 1; $i <= $width; $i++ )
imagesetpixel ( $output_image_resource, $i, $y, imagecolorat ( $input_image_resource, ( $i ), ( $height - $y ) ) );
$y = $y + 1;
}
return $output_image_resource;
}
?>
Edited by rus321, 11 January 2006 - 05:36 AM.
#3
Posted 11 January 2006 - 04:57 PM
That is a function to mirror the image, not get the dimensions.
Although, out of that function you would be looking specifically at:
http://php.net/manua...ion.imagesx.php
http://php.net/manua...ion.imagesy.php
And as an alternative to those, you can try the following function:
http://php.net/manua...etimagesize.php
Note: To get an images size, it has to be uploaded to a server some where where you can access it. I'm not sure if you get the the size of a temp file.
Although, out of that function you would be looking specifically at:
http://php.net/manua...ion.imagesx.php
http://php.net/manua...ion.imagesy.php
And as an alternative to those, you can try the following function:
http://php.net/manua...etimagesize.php
Note: To get an images size, it has to be uploaded to a server some where where you can access it. I'm not sure if you get the the size of a temp file.
#4
Posted 12 January 2006 - 10:30 PM
Thanks guys that helped alot
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users
