/** * When getting {@link #EVENT_NEW_TAG} in the tag area of IFD, the tag may * not contain the value if the size of the value is greater than 4 bytes. * When the value is not available here, call this method so that the parser * will emit {@link #EVENT_VALUE_OF_REGISTERED_TAG} when it reaches the area * where the value is located. * * @see #EVENT_VALUE_OF_REGISTERED_TAG */ protected void registerForTagValue( ExifTag tag ) { if( tag.getOffset() >= mTiffStream.getReadByteCount() ) { mCorrespondingEvent.put( tag.getOffset(), new ExifTagEvent( tag, true ) ); } }
/** * When getting {@link #EVENT_NEW_TAG} in the tag area of IFD, the tag may * not contain the value if the size of the value is greater than 4 bytes. * When the value is not available here, call this method so that the parser * will emit {@link #EVENT_VALUE_OF_REGISTERED_TAG} when it reaches the area * where the value is located. * * @see #EVENT_VALUE_OF_REGISTERED_TAG */ protected void registerForTagValue( ExifTag tag ) { if( tag.getOffset() >= mTiffStream.getReadByteCount() ) { mCorrespondingEvent.put( tag.getOffset(), new ExifTagEvent( tag, true ) ); } }
private void writeIfd( IfdData ifd, OrderedDataOutputStream dataOutputStream ) throws IOException { ExifTag[] tags = ifd.getAllTags(); dataOutputStream.writeShort( (short) tags.length ); for( ExifTag tag : tags ) { dataOutputStream.writeShort( tag.getTagId() ); dataOutputStream.writeShort( tag.getDataType() ); dataOutputStream.writeInt( tag.getComponentCount() ); // Log.v( TAG, "\n" + tag.toString() ); if( tag.getDataSize() > 4 ) { dataOutputStream.writeInt( tag.getOffset() ); } else { ExifOutputStream.writeTagValue( tag, dataOutputStream ); for( int i = 0, n = 4 - tag.getDataSize(); i < n; i++ ) { dataOutputStream.write( 0 ); } } } dataOutputStream.writeInt( ifd.getOffsetToNextIfd() ); for( ExifTag tag : tags ) { if( tag.getDataSize() > 4 ) { ExifOutputStream.writeTagValue( tag, dataOutputStream ); } } }
private void writeIfd( IfdData ifd, OrderedDataOutputStream dataOutputStream ) throws IOException { ExifTag[] tags = ifd.getAllTags(); dataOutputStream.writeShort( (short) tags.length ); for( ExifTag tag : tags ) { dataOutputStream.writeShort( tag.getTagId() ); dataOutputStream.writeShort( tag.getDataType() ); dataOutputStream.writeInt( tag.getComponentCount() ); // Log.v( TAG, "\n" + tag.toString() ); if( tag.getDataSize() > 4 ) { dataOutputStream.writeInt( tag.getOffset() ); } else { ExifOutputStream.writeTagValue( tag, dataOutputStream ); for( int i = 0, n = 4 - tag.getDataSize(); i < n; i++ ) { dataOutputStream.write( 0 ); } } } dataOutputStream.writeInt( ifd.getOffsetToNextIfd() ); for( ExifTag tag : tags ) { if( tag.getDataSize() > 4 ) { ExifOutputStream.writeTagValue( tag, dataOutputStream ); } } }
mCorrespondingEvent.put( tag.getOffset(), new ExifTagEvent( tag, false ) );
mCorrespondingEvent.put( tag.getOffset(), new ExifTagEvent( tag, false ) );