mirror of
https://github.com/sdsykes/fastimage.git
synced 2025-10-08 00:02:41 -04:00
Only pay attention to first APP1 segment for orientation. Fixes #102
This commit is contained in:
parent
c7cad12fa0
commit
15f3e95b25
@ -531,7 +531,8 @@ class FastImage
|
|||||||
io = StringIO.new(data)
|
io = StringIO.new(data)
|
||||||
if io.read(4) == "Exif"
|
if io.read(4) == "Exif"
|
||||||
io.read(2)
|
io.read(2)
|
||||||
exif = Exif.new(IOStream.new(io)) rescue nil
|
new_exif = Exif.new(IOStream.new(io)) rescue nil
|
||||||
|
exif ||= new_exif # only use the first APP1 segment
|
||||||
end
|
end
|
||||||
:started
|
:started
|
||||||
when 0xe0..0xef
|
when 0xe0..0xef
|
||||||
|
BIN
test/fixtures/orient_6.jpg
vendored
Normal file
BIN
test/fixtures/orient_6.jpg
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 597 KiB |
@ -34,7 +34,8 @@ GoodFixtures = {
|
|||||||
"test_partial_viewport.svg" => [:svg, [860, 400]],
|
"test_partial_viewport.svg" => [:svg, [860, 400]],
|
||||||
"test2.svg" => [:svg, [366, 271]],
|
"test2.svg" => [:svg, [366, 271]],
|
||||||
"test3.svg" => [:svg, [255, 48]],
|
"test3.svg" => [:svg, [255, 48]],
|
||||||
"test4.svg" => [:svg, [271, 271]]
|
"test4.svg" => [:svg, [271, 271]],
|
||||||
|
"orient_6.jpg"=>[:jpeg, [1250,2500]]
|
||||||
}
|
}
|
||||||
|
|
||||||
BadFixtures = [
|
BadFixtures = [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user