Jump to content

getimagesize giving wrong width n height ?


scooby545

Recommended Posts

hi,

 

am using getimagesize to get the width and height of an image

 

$dns_path = "http://www.mydomain.com";

 

$filename = "$dns_path/Uploads/Content/$row0[media]";

 

$fileinfo = getimagesize("$filename");

 

$imgwidth  = $fileinfo[0];

$imgheight  = $fileinfo[1];

 

have tried several variations of this script but just keep getting 1024 x 768 as the output :( have no idea where its getting those sizes from as the jpg is definatley there and is only 300 x 200 ?? am getting pretty confused and a little frustrated at this point  :facewall:

 

anyone have any ideas what could be going on and why im getting these values ?

 

any help on this would be greatly appreciated :)

 

dave

not as a fix for your code that, other wise looks fine, try testing with something like this:

<?php
      $img = imagecreatefromjpeg ($filename);
      $x = imagesx ($img);
      $y = imagesy ($img);
      imagedestroy ($img);
     echo "$x x $y";
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.