public byte[] getICCProfileBytes(ByteSource byteSource, Map params) throws ImageReadException, IOException { FormatCompliance formatCompliance = FormatCompliance.getDefault(); TiffContents contents = new TiffReader(isStrict(params)) .readFirstDirectory(byteSource, params, false, formatCompliance); TiffDirectory directory = (TiffDirectory) contents.directories.get(0); TiffField field = directory.findField(EXIF_TAG_ICC_PROFILE); if (null == field) return null; return field.oversizeValue; }
public byte[] getICCProfileBytes(ByteSource byteSource, Map params) throws ImageReadException, IOException { FormatCompliance formatCompliance = FormatCompliance.getDefault(); TiffContents contents = new TiffReader(isStrict(params)) .readFirstDirectory(byteSource, params, false, formatCompliance); TiffDirectory directory = (TiffDirectory) contents.directories.get(0); TiffField field = directory.findField(EXIF_TAG_ICC_PROFILE); if (null == field) return null; return field.oversizeValue; }
public BufferedImage getBufferedImage(ByteSource byteSource, Map params) throws ImageReadException, IOException { FormatCompliance formatCompliance = FormatCompliance.getDefault(); TiffContents contents = new TiffReader(isStrict(params)) .readFirstDirectory(byteSource, params, true, formatCompliance); TiffDirectory directory = (TiffDirectory) contents.directories.get(0); BufferedImage result = directory.getTiffImage(params); if (null == result) throw new ImageReadException("TIFF does not contain an image."); return result; }
public BufferedImage getBufferedImage(ByteSource byteSource, Map params) throws ImageReadException, IOException { FormatCompliance formatCompliance = FormatCompliance.getDefault(); TiffContents contents = new TiffReader(isStrict(params)) .readFirstDirectory(byteSource, params, true, formatCompliance); TiffDirectory directory = (TiffDirectory) contents.directories.get(0); BufferedImage result = directory.getTiffImage(params); if (null == result) throw new ImageReadException("TIFF does not contain an image."); return result; }
public Dimension getImageSize(ByteSource byteSource, Map params) throws ImageReadException, IOException { FormatCompliance formatCompliance = FormatCompliance.getDefault(); TiffContents contents = new TiffReader(isStrict(params)) .readFirstDirectory(byteSource, params, false, formatCompliance); TiffDirectory directory = (TiffDirectory) contents.directories.get(0); int width = directory.findField(TIFF_TAG_IMAGE_WIDTH).getIntValue(); int height = directory.findField(TIFF_TAG_IMAGE_LENGTH).getIntValue(); return new Dimension(width, height); }
public Dimension getImageSize(ByteSource byteSource, Map params) throws ImageReadException, IOException { FormatCompliance formatCompliance = FormatCompliance.getDefault(); TiffContents contents = new TiffReader(isStrict(params)) .readFirstDirectory(byteSource, params, false, formatCompliance); TiffDirectory directory = (TiffDirectory) contents.directories.get(0); int width = directory.findField(TIFF_TAG_IMAGE_WIDTH).getIntValue(); int height = directory.findField(TIFF_TAG_IMAGE_LENGTH).getIntValue(); return new Dimension(width, height); }