SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    PHP warrior dkode's Avatar
    Join Date
    Sep 2001
    Location
    Planet Namek
    Posts
    329
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    strange GetImageSize() problem

    I have the following code:

    PHP Code:
            $size GetImageSize($fpath);
            
    $img_type $size[2];

            
    // Check for valid filetype
            
    if ($img_type != 2) {
                echo 
    "invalid filetype<br>\n";
                 return 
    false;
            } 
    In a function that resizes image using the GD library. Now granted the resize thingy works perfect. The problem I am having seems to be with the GetImageSize function. On some images it resizes the images perfectly and returns 2 for $img_type (if $size[2] is equal to 2 then the image type is a jpg or jpeg and I am able to resize it) Now when i upload some jpg images getimagesize doesnt return anything. I echo'd $fpath and it is equal to the full path of the correct file. Why isnt it returning anything?
    "Mankind cannot define memory, yet it defines mankind"
    -- Project 2501, Ghost in the Shell

    Smarty | PEAR | PHP Manual | MySQL Manual

  2. #2
    SitePoint Evangelist
    Join Date
    May 2000
    Location
    Canada
    Posts
    533
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I believe that is a bug in PHP .. if the array does have the rest of the information right, you could just check the filename and set the value in the array if not already set .. (before using those values)...

    i'm not 100% sure when the bug came or will be fixed , but i do know that it was discussed in the manual errata, and that it is a bug..

    g'day,
    Vinay @ freeze


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •