darktable-org / rawspeed

fast raw decoding library
GNU Lesser General Public License v2.1
357 stars 113 forks source link

Better handling for slightly truncated CR2 #97

Open LynxChaus opened 7 years ago

LynxChaus commented 7 years ago
$ darktable-rs-identify Pictures/IMG_3030.CR2
Loading file: "Pictures/IMG_3030.CR2"
make: Canon
model: Canon EOS 700D
canonical_make: Canon
canonical_model: EOS 700D
canonical_alias: EOS 700D
ERROR: [rawspeed] RawSpeed::RawImage RawSpeed::RawDecoder::decodeRaw(), line 305: const uchar8* RawSpeed::Buffer::getData(RawSpeed::Buffer::size_type, RawSpeed::Buffer::size_type) const, line 103: Buffer overflow: image file may be truncated

Raw direct from camera, manual M42 lens with chinese "focus assist" chip on ring. Grab raw here: IMG_3030.CR2

LebedevRI commented 7 years ago

Are all the raw files from that camera are like that? Have you tried different SD card, newer firmware? Either the file is slightly truncated, or the camera wrote corrupted file.

LynxChaus commented 7 years ago

Files damaged when transferred over wire. Sorry for noise.

LebedevRI commented 7 years ago

Files damaged when transferred over wire.

I'm sorry to hear that... However in this case, given that the file is just few bytes short, i guess rawspeed should not completely refuse to load it. I have an idea how to workaround this particular case, so i'll keep the issue for now.