ruby-imagespec
ruby-imagespec copied to clipboard
Bug fix for Exif JPEGS
When a JPEG contains a Exif header, the parser gets into troubles. This bug fix may solve the problem:
in JPEG.rb
def self.detected?(stream)
stream.rewind
case stream.read(10)
when /^\xff\xd8\xff\xe0\x00\x10JFIF/ then true
when /^\xff\xd8\xff\xe1/ && /Exif$/ then true # bug fix, cannot do match *
# when /^\xff\xd8\xff\xe1(.*){1}Exif/ then true
else false
end
end