Closed fabioperrella closed 4 years ago
Thanks for reporting this! You solution looks fine. Let's include some logging too:
@jpeg_thumbnails = @ifds.map do |v|
if v.jpeg_interchange_format && v.jpeg_interchange_format_length
start, length = v.jpeg_interchange_format, v.jpeg_interchange_format_length
if Integer === start && Integer === length
data[start..(start + length)]
else
EXIFR.logger.warn("Non numeric JpegInterchangeFormat data")
nil
end
end
end.compact
Can you make a PR? I'd like a test case with a fixture but this seems so obvious, I'll accept it without one too.
great, I will do it tomorrow!
Fixed by #66
Hi,
First of all, thanks for all your work with that gem!
We found an error when parsing files from Olympus microscope (I'm not 100% sure about that orign, more details below).
An example:
For this file, I run
exiftool
and got this output:The error is raised because the
start
is not an integer at this point:I noticed that exiftool also warns about that:
At this moment, I can't share the file that I used to test, because I got it from the production server and it belongs to a customer. I'm trying to ask for permission to use it as a fixture.
Would it be possible to change something to avoid raising this error?
Maybe detecting that it's not a number and skipping like this: