Sorry, I don't have too much experience with c++ but I figured this would be a good chance to give it a shot. I added a handler for the JERR_NO_SOI which comes up when fragments are not grouped properly and a fragment with no SOI is passed into the JPEG code. I also modified the behavior of gdcm::JPEGCodec::Decode to return false instead of fail on the assertion when nfrags != this->GetNumberOfDimensions() And lastly I modified the python generating swig to return None instead of an empty buffer...
This closes https://sourceforge.net/p/gdcm/bugs/550/
Fix Not a JPEG error
MAIN: Add error handler for missing SOI
Edit: Added wrong google drive link: https://drive.google.com/file/d/1RIIhsXIazVEINSHqFcHAPidgiOrvDs1T/view
Issue decompressing large multi-frame image
Errors not propagated to python swig-generated code