private static void printLine(int indentLevels, String text, int value, int minValidValue) { if (value >= minValidValue) { printLine(indentLevels, text, Integer.toString(value)); } }
private static void printVerbose(String sourceName, ImageInfo ii) { printLine(0, null, sourceName); printLine(1, "File format: ", ii.getFormatName()); printLine(1, "MIME type: ", ii.getMimeType()); printLine(1, "Width (pixels): ", ii.getWidth(), 1); printLine(1, "Height (pixels): ", ii.getHeight(), 1); printLine(1, "Bits per pixel: ", ii.getBitsPerPixel(), 1); printLine(1, "Progressive: ", ii.isProgressive() ? "yes" : "no"); printLine(1, "Number of images: ", ii.getNumberOfImages(), 1); printLine(1, "Physical width (dpi): ", ii.getPhysicalWidthDpi(), 1); printLine(1, "Physical height (dpi): ", ii.getPhysicalHeightDpi(), 1); printLine(1, "Physical width (inches): ", ii.getPhysicalWidthInch(), 1.0f); printLine(1, "Physical height (inches): ", ii.getPhysicalHeightInch(), 1.0f); int numComments = ii.getNumberOfComments(); printLine(1, "Number of textual comments: ", numComments, 1); if (numComments > 0) { for (int i = 0; i < numComments; i++) { printLine(2, null, ii.getComment(i)); } } }
private static void printLine(int indentLevels, String text, float value, float minValidValue) { if (value < minValidValue) { return; } printLine(indentLevels, text, Float.toString(value)); }