mattiasw/ExifReader — pull request #3 by mattcg (2013-04-23 05:32:59+00:00)
Title: Support hybrid JFIF-EXIF image files

Some applications (like Preview on Mac OS X) will save images in a hybrid JFIF-EXIF format even when exporting directly from EXIF format images.

To support images in this hybrid format, I've refactored `_checkImageHeader` so that it adjusts `_tiffHeaderOffset` (only for the instance, not the prototype) to the correct offset.

Attached is an example image in this hybrid format, so that you may test it.

![1](https://f.cloud.github.com/assets/282964/412901/4f1849c0-abd6-11e2-9e9c-2d7216348f2e.JPG)

If you view the image file in a hex editor, you'll see that the first 10 bytes are:

```
FF D8 FF E0 00 10 4A 46 49 46
```

The bytes 6-10 are the string `JFIF`. At offset 3186, the bytes `45 78 69 66` (`Exif`) appear.

In the change I made, ExifReader will read until it finds that byte sequence if it detects the JFIF signature at the beginning of the file.