{"record":{"id":"86ea79cdc094cef7","repo":"Yalantis/uCrop","slug":"cimgdisplay-display-empty-specified-image","errorCode":null,"errorMessage":"CImgDisplay::display(): Empty specified image.","messagePattern":"CImgDisplay::display\\(\\): Empty specified image\\.","errorType":"exception","errorClass":"CImgArgumentException","httpStatus":null,"severity":"error","filePath":"ucrop/src/main/jni/CImg.h","lineNumber":10853,"sourceCode":"      if (!std::strcmp(_title,tmp)) { delete[] tmp; return *this; }\n      delete[] _title;\n      const unsigned int s = (unsigned int)std::strlen(tmp) + 1;\n      _title = new char[s];\n      std::memcpy(_title,tmp,s*sizeof(char));\n\n      cimg::X11_attr &X11_attr = cimg::X11_attr::ref();\n      Display *const dpy = X11_attr.display;\n      X11_attr.lock();\n      XStoreName(dpy,_window,tmp);\n      X11_attr.unlock();\n      delete[] tmp;\n      return *this;\n    }\n\n    template<typename T>\n    CImgDisplay& display(const CImg<T>& img) {\n      if (!img)\n        throw CImgArgumentException(_cimgdisplay_instance\n                                    \"display(): Empty specified image.\",\n                                    cimgdisplay_instance);\n      if (is_empty()) return assign(img);\n      return render(img).paint(false);\n    }\n\n    CImgDisplay& paint(const bool wait_expose=true) {\n      if (is_empty()) return *this;\n      cimg::X11_attr &X11_attr = cimg::X11_attr::ref();\n      X11_attr.lock();\n      _paint(wait_expose);\n      X11_attr.unlock();\n      return *this;\n    }\n\n    template<typename T>\n    CImgDisplay& render(const CImg<T>& img, const bool flag8=false) {\n      if (!img)","sourceCodeStart":10835,"sourceCodeEnd":10871,"githubUrl":"https://github.com/Yalantis/uCrop/blob/f788b534b48c144edf786c8cddbf0e029e637804/ucrop/src/main/jni/CImg.h#L10835-L10871","documentation":"Thrown by CImgDisplay::display() when it is asked to render an image into the display window, but the passed CImg instance is empty (null data / zero size, i.e. CImg's operator bool is false). This is a guard against a default-constructed or failed-load image being pushed to the screen; populate the image (load or assign) before calling display().","triggerScenarios":"Thrown at ucrop/src/main/jni/CImg.h:10853 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Load or construct the image (e.g. with CImg::load or assign) and verify it is non-empty via is_empty() before calling display()","Check the return value of the loading step that produced the image; a failed load often yields an empty image"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f788b534b48c144edf786c8cddbf0e029e637804","analyzedAt":"2026-09-08T08:36:04.887Z","contentChangedAt":"2026-09-08T08:36:04.887Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}