Remove parsing of IFDs other than IFD0 in EXIF, IFD0 should have everything needed. Caused incorrect orientation in certain jpegs

This commit is contained in:
Stephen Sykes 2014-04-29 00:18:46 +03:00
parent 5aaa16fb4b
commit 327a3b55cd
4 changed files with 3 additions and 9 deletions

View File

@ -475,13 +475,6 @@ class FastImage
end
@stream.read(2)
end
next_offset = @stream.read(4).unpack(@long)[0]
relative_offset = next_offset - (@stream.pos - @start_byte)
if relative_offset >= 0
@stream.read(relative_offset)
parse_exif_ifd
end
end
def parse_exif

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 MiB

After

Width:  |  Height:  |  Size: 134 KiB

BIN
test/fixtures/orient_2.jpg vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

View File

@ -22,8 +22,9 @@ GoodFixtures = {
"test.tiff"=>[:tiff, [85, 67]],
"test2.tiff"=>[:tiff, [333, 225]],
"test.psd"=>[:psd, [17, 32]],
"exif_orientation.jpg"=>[:jpeg, [2448, 3264]],
"infinite.jpg"=>[:jpeg, [160,240]]
"exif_orientation.jpg"=>[:jpeg, [600, 450]],
"infinite.jpg"=>[:jpeg, [160,240]],
"orient_2.jpg"=>[:jpeg, [230,408]]
}
BadFixtures = [