{"record":{"id":"d3feef10f9a8362a","repo":"Yalantis/uCrop","slug":"load-pandore-unable-to-load-data-with-id-type","errorCode":null,"errorMessage":"load_pandore(): Unable to load data with ID_type %u in file '%s'.","messagePattern":"load_pandore\\(\\): Unable to load data with ID_type %u in file '(.+?)'\\.","errorType":"exception","errorClass":"CImgIOException","httpStatus":null,"severity":"error","filePath":"ucrop/src/main/jni/CImg.h","lineNumber":59010,"sourceCode":"      case 33 : _cimg_load_pandore_case(4,dims[3],dims[2],dims[1],dims[0],double,float,float,4); break;\n      case 34 : { // Points 1D\n        cimg::fread(ptbuf,1,nfile);\n        if (endian) cimg::invert_endianness(ptbuf,1);\n        assign(1); (*this)(0) = (T)ptbuf[0];\n      } break;\n      case 35 : { // Points 2D\n        cimg::fread(ptbuf,2,nfile);\n        if (endian) cimg::invert_endianness(ptbuf,2);\n        assign(2); (*this)(0) = (T)ptbuf[1]; (*this)(1) = (T)ptbuf[0];\n      } break;\n      case 36 : { // Points 3D\n        cimg::fread(ptbuf,3,nfile);\n        if (endian) cimg::invert_endianness(ptbuf,3);\n        assign(3); (*this)(0) = (T)ptbuf[2]; (*this)(1) = (T)ptbuf[1]; (*this)(2) = (T)ptbuf[0];\n      } break;\n      default :\n        if (!file) cimg::fclose(nfile);\n        throw CImgIOException(_cimg_instance\n                              \"load_pandore(): Unable to load data with ID_type %u in file '%s'.\",\n                              cimg_instance,\n                              imageid,filename?filename:\"(FILE*)\");\n      }\n      if (!file) cimg::fclose(nfile);\n      return *this;\n    }\n\n    //! Load image from a PAR-REC (Philips) file.\n    /**\n      \\param filename Filename, as a C-string.\n      \\param axis Appending axis, if file contains multiple images. Can be <tt>{ 'x' | 'y' | 'z' | 'c' }</tt>.\n      \\param align Appending alignment.\n    **/\n    CImg<T>& load_parrec(const char *const filename, const char axis='c', const float align=0) {\n      CImgList<T> list;\n      list.load_parrec(filename);\n      if (list._width==1) return list[0].move_to(*this);","sourceCodeStart":58992,"sourceCodeEnd":59028,"githubUrl":"https://github.com/Yalantis/uCrop/blob/f788b534b48c144edf786c8cddbf0e029e637804/ucrop/src/main/jni/CImg.h#L58992-L59028","documentation":"After parsing the PANDORE header, _load_pandore() switches on the object's ID_type to select a decoder branch. The default branch handles any ID_type this CImg version doesn't implement and throws CImgIOException including the numeric ID_type. The file is structurally valid PANDORE, but its object type (e.g. color images, graphs, 3D types) isn't supported here.","triggerScenarios":"Loading a .pan file whose ID_type is a newer or non-image PANDORE object (newer format versions, graphs, multispectral data) that falls into the switch's default case.","commonSituations":"PANDORE files produced by newer versions of the PANDORE library than this CImg copy supports; non-image PANDORE objects (collections, graphs) passed to an image loader; misidentified file.","solutions":["Convert the object to a supported image type (e.g. grayscale/RGB PanImage) with PANDORE tools (e.g. pextractplane, pconvert) before loading","Upgrade CImg to a version whose switch covers your file's ID_type","Load the file with the PANDORE library itself and export to a standard image format CImg can read","Verify the ID_type is an image type at all — non-image PANDORE objects cannot be loaded as CImg images"],"exampleFix":"// before\nimg.load_pandore(\"new_version.pan\"); // ID_type not handled\n// after\n// convert with PANDORE tooling to a classic image type, then:\nsystem(\"pconvert new_version.pan out.pan\");\nimg.load_pandore(\"out.pan\");","handlingStrategy":"try-catch","validationCode":"// Read the PANDORE header and check ID_type is one your CImg build supports before loading.\n// If in doubt, pre-convert with PANDORE tools (pconvert) to a classic image type.","typeGuard":null,"tryCatchPattern":"try { img.load_pandore(path); } catch (const cimg_library::CImgIOException &e) { // unsupported ID_type\n  convert_with_pandore_tools(path); img.load_pandore(converted); }","preventionTips":["Pin CImg versions compatible with the PANDORE library version producing your files","Pre-convert newer/exotic PANDORE objects to standard image types","Batch-validate ID_types in a pipeline before mass conversion"],"tags":["cimg","image-loading","pandore","unsupported-type"],"backgroundTag":"unsupported-enum-value","analyzedSha":"f788b534b48c144edf786c8cddbf0e029e637804","analyzedAt":"2026-09-08T08:36:04.887Z","contentChangedAt":"2026-09-08T08:36:04.887Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}