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

Link to comment
Share on other sites

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";
?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.