private void writeThumbnail( OrderedDataOutputStream dataOutputStream ) throws IOException { if( mExifData.hasCompressedThumbnail() ) { Log.d( TAG, "writing thumbnail.." ); dataOutputStream.write( mExifData.getCompressedThumbnail() ); } else if( mExifData.hasUncompressedStrip() ) { Log.d( TAG, "writing uncompressed strip.." ); for( int i = 0; i < mExifData.getStripCount(); i++ ) { dataOutputStream.write( mExifData.getStrip( i ) ); } } }
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 writeThumbnail( OrderedDataOutputStream dataOutputStream ) throws IOException { if( mExifData.hasCompressedThumbnail() ) { Log.d( TAG, "writing thumbnail.." ); dataOutputStream.write( mExifData.getCompressedThumbnail() ); } else if( mExifData.hasUncompressedStrip() ) { Log.d( TAG, "writing uncompressed strip.." ); for( int i = 0; i < mExifData.getStripCount(); i++ ) { dataOutputStream.write( mExifData.getStrip( i ) ); } } }
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 ); } } }