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? Quote Link to comment Share on other sites More sharing options...
onlyican Posted September 2, 2006 Share Posted September 2, 2006 list($width, $height) = getimagesize($img); Quote Link to comment 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 Quote Link to comment 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; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.