@Override
    public boolean loadImage(@NotNull InputStream inputStream) {
        super.loadImage(inputStream);
        try {
            SWTException lastError = getLastError();
            if (lastError != null) {
                messageLabel.setText(lastError.getMessage());
                messageLabel.setForeground(redColor);
                return false;
            } else {
                messageLabel.setText(getImageDescription());
                messageLabel.setForeground(blackColor);
                return true;
            }
        } finally {
            updateActions();
        }
    }
Image editor, based on image viewer.
plugins/org.jkiss.dbeaver.ui.editors.image/src/org/jkiss/dbeaver/ui/controls/imageview/SWTImageEditor.java