Closed joshuamcginnis closed 10 years ago
I'm getting similar errors for lots of images. I believe some of these images not to have any exif data in them anyway, but I was expecting in that case (at least if the file is not broken) for no error message, but an empty exif object.
I'm also encountering this error.
@joshuamcginnis: The image you provided does look tasty but doesn't seem to contain any exif data, as @tremby already suspected. The error is raised because no start marker for exif data was found in the image.
@tremby: Do you really want to get an empty exif object in return? I think it makes sense to throw an error of some kind you can react on in your application. Don't you think? I have to admit that it is worth discussing if the error message is meaningful enough...
Definitely. Asking for exif data and there being none isn't an error to me. There's just no exif data. What's hard about reacting on an empty object, or length === 0? But I can adapt to whatever you think is best.
The more I think of it the more I think your approach would be the better one. Maybe I've simply been coding too much Java lately and like to throw errors around... :)
Switched from returning an error to returning an empty object as @tremby proposed. Makes sense.
The change is already pushed to GitHub but not yet published to npm. I'm going to publish it in a couple of days, as I want to have one or two additional changes done first.
Change made in version 0.4.0.
I'm having issues getting the lib to return Exif data for regular plain-ol JPGs. I've attached one that does not work. Your example image does work, however, many other images I try do not.
Returns the following error for the referenced image: