{"record":{"id":"712b0066744f855d","repo":"pentaho/pentaho-kettle","slug":"unable-to-load-image-from-file-imagefile-for-plugin-plugin","errorCode":null,"errorMessage":"Unable to load image from file : '<imageFile>' for plugin: <plugin>","messagePattern":"Unable to load image from file : '<imageFile>' for plugin: <plugin>","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/core/gui/SwingGUIResource.java","lineNumber":193,"sourceCode":"            BufferedImage bitmap = ImageIO.read( inputStream );\n\n            WaitingImageObserver wia = new WaitingImageObserver( bitmap );\n            wia.waitImageLoaded();\n\n            image = new SwingUniversalImageBitmap( bitmap );\n          } finally {\n            IOUtils.closeQuietly( inputStream );\n          }\n        }\n      }\n\n      if ( image == null ) {\n        throw new KettleException( \"Unable to find file: \" + plugin.getImageFile() + \" for plugin: \" + plugin );\n      }\n\n      return image;\n    } catch ( Throwable e ) {\n      throw new KettleException( \"Unable to load image from file : '\"\n        + plugin.getImageFile() + \"' for plugin: \" + plugin, e );\n    }\n  }\n\n  public Map<String, SwingUniversalImage> getEntryImages() {\n    return entryImages;\n  }\n\n  public Map<String, SwingUniversalImage> getStepImages() {\n    return stepImages;\n  }\n}\n","sourceCodeStart":175,"sourceCodeEnd":206,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/core/gui/SwingGUIResource.java#L175-L206","documentation":"Wrapper KettleException thrown when any Throwable escapes getUniversalImageIcon while loading a plugin image (e.g. IOException decoding the image, class loading failure). It reports the image file and plugin but hides the underlying cause as the cause chain.","triggerScenarios":"The image file was found but reading/decoding it threw: corrupt PNG/GIF/SVG, truncated file, unsupported format, or an IO error while reading the stream.","commonSituations":"Icons corrupted during transfer/checkout (line-ending conversion), zero-byte files from failed downloads, image formats not supported by SwingGraphicsUtilities.","solutions":["Inspect the cause chain (getCause) to find the underlying IO/decode exception","Replace the corrupt or unsupported icon file with a valid PNG/SVG","Re-checkout or re-download plugin resources and verify checksums","Convert the icon to a format supported by the Kettle Swing image loader"],"exampleFix":"// before: zero-byte icons/step.png\n// after: replace with a valid PNG\nfile icons/step.png -> 128x128 valid PNG, rebuild plugin jar","handlingStrategy":"try-catch","validationCode":"// verify readability before load\njava.io.File f = new java.io.File(plugin.getImageFile());\nif (f.exists() && f.length() == 0) throw new IllegalStateException(\"Corrupt empty image: \" + f);","typeGuard":null,"tryCatchPattern":"try { return getUniversalImageIcon(plugin); }\ncatch (KettleException e) {\n  log.logError(\"Image decode failed: \" + plugin.getImageFile() + \", cause=\" + e.getCause(), e);\n  return fallbackImage;\n}","preventionTips":["Always inspect getCause() — this error wraps the real exception","Validate icons open in a standard image viewer before packaging","Use git lfs / binary-safe transfer to avoid corruption"],"tags":["pentaho-kettle","gui","image-loading","plugin"],"backgroundTag":"file-read-failed","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}