Hello,
I am having terrible problems trying to get the following code to
work where $uploadFile contains full path to an image

imagecreatefromJPEG($uploadFile);
if(!$uploadedresource){
//unlink($uploadFile);
return "Invalid JPG Image detected";
}

I am testing on PHP 4.3.4 under windows and have gd 2.0.15 (bundled) with jpeg support enabled. I also cant get it to work on
my hosting provider.

I have tried both large and small jpeg images both ones i have created and ones others have and it the above code always
prints "Invaid JPG Image detected"

Help greatly appreciated
Cheers
Richard Pearson

    Hi,

    You never catch the created image.

    $uploadedresource = imagecreatefromJPEG($uploadFile);
    if(!$uploadedresource){
      //unlink($uploadFile);
      return "Invalid JPG Image detected";
    }

    Yours, Erik.

      Thanks,
      Your a star. Sometimes you just make silly mistakes when your in a hurry and just cant see them now matter how hard you look.
      cheers again
      Richard Pearson

        Hi,

        I have made similar mistakes myself. 😃

        Yours, Erik.

          Write a Reply...