Skip to content
This repository has been archived by the owner on Dec 9, 2021. It is now read-only.

Commit

Permalink
Fixed bug with PNG/GIF not seeking to the right point in the stream
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Sheakoski committed Feb 18, 2009
1 parent 5a24fec commit 7582f19
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/parsers/gif.rb
Expand Up @@ -3,7 +3,8 @@ module ImageSpec
class GIF

def self.dimensions(file)
file.read(4, 6).unpack('SS')
file.seek(6)
file.read(4).unpack('SS')
end

end
Expand Down
3 changes: 2 additions & 1 deletion lib/parsers/png.rb
Expand Up @@ -3,7 +3,8 @@ module ImageSpec
class PNG

def self.dimensions(file)
file.read(8, 0x10).unpack('NN')
file.seek(0x10)
file.read(8).unpack('NN')
end

end
Expand Down

0 comments on commit 7582f19

Please sign in to comment.