note 81380 added to function.getimagesize
| From: | cloned at clonedmadman dot com | Date: | Mon, 25 Feb 2008 22:01:19 +0000 |
| Subject: | note 81380 added to function.getimagesize | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-136479@lists.php.net to get a copy of this message | ||
Well, I am making a script which will resize the image when uploaded, however, i am making a
multi-uploader, so i came across with a problem: an efficient way of getting a pictures height and
width and storing them in an array to resize later. This is what i came up with:
<?php
$links = array("test1.jpg", "test2.png");
$sizearray = array();
$count = count($links);
for($i = 0; $i < $count; $i++) {
$size = getimagesize($links[$i]);
list($width, $height) = $size;
$sizearray[$links[$i]] = array("width" => $width, "height" => $height);
}
print_r($sizearray);
// which will print out: Array ( [test1.jpg] => Array ( [width] => 300 [height] => 400 )
[test2.png] => Array ( [width] => 680 [height] => 100 ) )
?>
----
Server IP: 83.170.119.58
Probable Submitter: 88.111.206.139
----
Manual Page -- http://www.php.net/manual/en/function.getimagesize.php
Edit -- https://master.php.net/note/edit/81380
Del: integrated -- https://master.php.net/note/delete/81380/integrated
Del: useless -- https://master.php.net/note/delete/81380/useless
Del: bad code -- https://master.php.net/note/delete/81380/bad+code
Del: spam -- https://master.php.net/note/delete/81380/spam
Del: non-english -- https://master.php.net/note/delete/81380/non-english
Del: in docs -- https://master.php.net/note/delete/81380/in+docs
Del: other reasons-- https://master.php.net/note/delete/81380
Reject -- https://master.php.net/note/reject/81380
Search -- https://master.php.net/manage/user-notes.php