public TiffField findField(TagInfo tag) throws ImageReadException { boolean failIfMissing = false; return findField(tag, failIfMissing); }
public boolean hasJpegImageData() throws ImageReadException { if (null != findField(TIFF_TAG_JPEG_INTERCHANGE_FORMAT)) return true; return false; }
public boolean hasJpegImageData() throws ImageReadException { if (null != findField(TIFF_TAG_JPEG_INTERCHANGE_FORMAT)) return true; return false; }
public TiffField findField(TagInfo tag) throws ImageReadException { boolean failIfMissing = false; return findField(tag, failIfMissing); }
public TiffField findField(TagInfo tagInfo) throws ImageReadException { return directory.findField(tagInfo); }
public TiffField findField(TagInfo tagInfo) throws ImageReadException { return directory.findField(tagInfo); }
public boolean imageDataInStrips() throws ImageReadException { TiffField tileOffsets = findField(TIFF_TAG_TILE_OFFSETS); TiffField tileByteCounts = findField(TIFF_TAG_TILE_BYTE_COUNTS); TiffField stripOffsets = findField(TIFF_TAG_STRIP_OFFSETS); TiffField stripByteCounts = findField(TIFF_TAG_STRIP_BYTE_COUNTS); if ((tileOffsets != null) && (tileByteCounts != null)) return false; else if ((stripOffsets != null) && (stripByteCounts != null)) return true; else if ((stripOffsets != null) && (stripByteCounts != null)) return true; else throw new ImageReadException("Couldn't find image data."); }
public boolean imageDataInStrips() throws ImageReadException { TiffField tileOffsets = findField(TIFF_TAG_TILE_OFFSETS); TiffField tileByteCounts = findField(TIFF_TAG_TILE_BYTE_COUNTS); TiffField stripOffsets = findField(TIFF_TAG_STRIP_OFFSETS); TiffField stripByteCounts = findField(TIFF_TAG_STRIP_BYTE_COUNTS); if ((tileOffsets != null) && (tileByteCounts != null)) return false; else if ((stripOffsets != null) && (stripByteCounts != null)) return true; else if ((stripOffsets != null) && (stripByteCounts != null)) return true; else throw new ImageReadException("Couldn't find image data."); }
public TiffField findField(TagInfo tag) throws ImageReadException { for (int i = 0; i < directories.size(); i++) { TiffDirectory directory = (TiffDirectory) directories.get(i); TiffField field = directory.findField(tag); if (null != field) return field; } return null; }
public TiffField findField(TagInfo tag) throws ImageReadException { for (int i = 0; i < directories.size(); i++) { TiffDirectory directory = (TiffDirectory) directories.get(i); TiffField field = directory.findField(tag); if (null != field) return field; } return null; }
public ArrayList getTiffRawImageDataElements() throws ImageReadException { TiffField tileOffsets = findField(TIFF_TAG_TILE_OFFSETS); TiffField tileByteCounts = findField(TIFF_TAG_TILE_BYTE_COUNTS); TiffField stripOffsets = findField(TIFF_TAG_STRIP_OFFSETS); TiffField stripByteCounts = findField(TIFF_TAG_STRIP_BYTE_COUNTS); if ((tileOffsets != null) && (tileByteCounts != null)) { return getRawImageDataElements(tileOffsets, tileByteCounts); } else if ((stripOffsets != null) && (stripByteCounts != null)) { return getRawImageDataElements(stripOffsets, stripByteCounts); } else throw new ImageReadException("Couldn't find image data."); }
public ArrayList getTiffRawImageDataElements() throws ImageReadException { TiffField tileOffsets = findField(TIFF_TAG_TILE_OFFSETS); TiffField tileByteCounts = findField(TIFF_TAG_TILE_BYTE_COUNTS); TiffField stripOffsets = findField(TIFF_TAG_STRIP_OFFSETS); TiffField stripByteCounts = findField(TIFF_TAG_STRIP_BYTE_COUNTS); if ((tileOffsets != null) && (tileByteCounts != null)) { return getRawImageDataElements(tileOffsets, tileByteCounts); } else if ((stripOffsets != null) && (stripByteCounts != null)) { return getRawImageDataElements(stripOffsets, stripByteCounts); } else throw new ImageReadException("Couldn't find image data."); }
public ImageDataElement getJpegRawImageDataElement() throws ImageReadException { TiffField jpegInterchangeFormat = findField(TIFF_TAG_JPEG_INTERCHANGE_FORMAT); TiffField jpegInterchangeFormatLength = findField(TIFF_TAG_JPEG_INTERCHANGE_FORMAT_LENGTH); if ((jpegInterchangeFormat != null) && (jpegInterchangeFormatLength != null)) { int offset = jpegInterchangeFormat.getIntArrayValue()[0]; int byteCount = jpegInterchangeFormatLength.getIntArrayValue()[0]; return new ImageDataElement(offset, byteCount); } else throw new ImageReadException("Couldn't find image data."); }
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 ImageDataElement getJpegRawImageDataElement() throws ImageReadException { TiffField jpegInterchangeFormat = findField(TIFF_TAG_JPEG_INTERCHANGE_FORMAT); TiffField jpegInterchangeFormatLength = findField(TIFF_TAG_JPEG_INTERCHANGE_FORMAT_LENGTH); if ((jpegInterchangeFormat != null) && (jpegInterchangeFormatLength != null)) { int offset = jpegInterchangeFormat.getIntArrayValue()[0]; int byteCount = jpegInterchangeFormatLength.getIntArrayValue()[0]; return new ImageDataElement(offset, byteCount); } else throw new ImageReadException("Couldn't find image data."); }
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 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; }