PHP GD and corrupted image

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

I'm using GD library in my web application to manage (resize, creating
thumbnails etc.) images for a web site.
My script works fine for most images but I've got a problem with some
jpeg images, that are
not recognized as valid jpeg images: getimagesize returns false, while
using exif_read_data
I get a warning like: "Error reading from file: got=xB6F2(=46834) !=

Opening the image with Gimp I actually get a warning message:
"Corrupt JPEG Data: 16 extraneous bytes before marker 0xdb"
Gimp is able to skip exif data and to correctly open the image.

I think that removing exif data I could read and resiz the image.
My question is: how can I skip exif data using php script as Gimp or
any other image viewer does?

thank you.

Site Timeline