Madatan Posted September 2, 2006 Share Posted September 2, 2006 [code]<?php$path= "fotoalbum/".$HTTP_POST_FILES['ufile']['name'];$filename = $HTTP_POST_FILES['ufile']['name'];if(copy($HTTP_POST_FILES['ufile']['tmp_name'], $path) && $bilder < $maxbilder && $fotoalbum != ''){ $extension = strrchr($filename, '.'); $extension = strtolower($extension); switch($extension) { case '.jpg': case '.jpeg': $im = @imagecreatefromjpeg($filename); break; case '.gif': $im = @imagecreatefromgif($filename); break; // ... etc default: $im = false; break; }if ($filename == false) { die ('Unable to open image');}$bildy = imagesy($im);$bildx = imagesx($im);?>[/code]I can't get this to work, anyone got any ideas on how to do this? Link to comment https://forums.phpfreaks.com/topic/19499-getting-width-and-height-from-an-image-help/ Share on other sites More sharing options...
onlyican Posted September 2, 2006 Share Posted September 2, 2006 list($width, $height) = getimagesize($img); Link to comment https://forums.phpfreaks.com/topic/19499-getting-width-and-height-from-an-image-help/#findComment-84767 Share on other sites More sharing options...
Madatan Posted September 2, 2006 Author Share Posted September 2, 2006 It wont work, still not getting any width or height values Link to comment https://forums.phpfreaks.com/topic/19499-getting-width-and-height-from-an-image-help/#findComment-84773 Share on other sites More sharing options...
onlyican Posted September 2, 2006 Share Posted September 2, 2006 where $img is the image (use the one on the server)and $width is the widthand $height is the heightso $img = "images/myimage.jpg";list($width, $height) = getimagesize($img);echo "Width is ".$width."<br />\n"."And Height is ".$height; Link to comment https://forums.phpfreaks.com/topic/19499-getting-width-and-height-from-an-image-help/#findComment-84788 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.