/** * Adds or replaces a {@link ExifTag}. */ protected ExifTag setTag( ExifTag tag ) { tag.setIfd( mIfdId ); return mExifTags.put( tag.getTagId(), tag ); }
/** * Adds or replaces a {@link ExifTag}. */ protected ExifTag setTag( ExifTag tag ) { tag.setIfd( mIfdId ); return mExifTags.put( tag.getTagId(), tag ); }
private ArrayList<ExifTag> stripNullValueTags( ExifData data ) { ArrayList<ExifTag> nullTags = new ArrayList<ExifTag>(); for( ExifTag t : data.getAllTags() ) { if( t.getValue() == null && ! ExifInterface.isOffsetTag( t.getTagId() ) ) { data.removeTag( t.getTagId(), t.getIfd() ); nullTags.add( t ); } } return nullTags; }
private ArrayList<ExifTag> stripNullValueTags( ExifData data ) { ArrayList<ExifTag> nullTags = new ArrayList<ExifTag>(); for( ExifTag t : data.getAllTags() ) { if( t.getValue() == null && ! ExifInterface.isOffsetTag( t.getTagId() ) ) { data.removeTag( t.getTagId(), t.getIfd() ); nullTags.add( t ); } } return nullTags; }
@SuppressWarnings( "unused" ) protected int getTagDefinitionForTag( ExifTag tag ) { short type = tag.getDataType(); int count = tag.getComponentCount(); int ifd = tag.getIfd(); return getTagDefinitionForTag( tag.getTagId(), type, count, ifd ); }
@SuppressWarnings( "unused" ) protected int getTagDefinitionForTag( ExifTag tag ) { short type = tag.getDataType(); int count = tag.getComponentCount(); int ifd = tag.getIfd(); return getTagDefinitionForTag( tag.getTagId(), type, count, ifd ); }
/** * Returns true if all tags in this two IFDs are equal. Note that tags of * IFDs offset or thumbnail offset will be ignored. */ @Override public boolean equals( Object obj ) { if( this == obj ) { return true; } if( obj == null ) { return false; } if( obj instanceof IfdData ) { IfdData data = (IfdData) obj; if( data.getId() == mIfdId && data.getTagCount() == getTagCount() ) { ExifTag[] tags = data.getAllTags(); for( ExifTag tag : tags ) { if( ExifInterface.isOffsetTag( tag.getTagId() ) ) { continue; } ExifTag tag2 = mExifTags.get( tag.getTagId() ); if( ! tag.equals( tag2 ) ) { return false; } } return true; } } return false; }
/** * Returns true if all tags in this two IFDs are equal. Note that tags of * IFDs offset or thumbnail offset will be ignored. */ @Override public boolean equals( Object obj ) { if( this == obj ) { return true; } if( obj == null ) { return false; } if( obj instanceof IfdData ) { IfdData data = (IfdData) obj; if( data.getId() == mIfdId && data.getTagCount() == getTagCount() ) { ExifTag[] tags = data.getAllTags(); for( ExifTag tag : tags ) { if( ExifInterface.isOffsetTag( tag.getTagId() ) ) { continue; } ExifTag tag2 = mExifTags.get( tag.getTagId() ); if( ! tag.equals( tag2 ) ) { return false; } } return true; } } return false; }
Log.i( LOG_TAG, "---- remaining tags ---" ); for( ExifTag remaining_tag : all_tags ) { Log.v( LOG_TAG, "tag: " + String.format( "0x%X", remaining_tag.getTagId() ) + ", value: " + remaining_tag );
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 ); } } }
if (parser.isDefinedTag(tag.getIfd(), tag.getTagId())) { exifData.getIfdData(tag.getIfd()).setTag(tag);
if (parser.isDefinedTag(tag.getIfd(), tag.getTagId())) { exifData.getIfdData(tag.getIfd()).setTag(tag);
return; short tid = tag.getTagId(); int ifd = tag.getIfd(); if( tid == TAG_EXIF_IFD && checkAllowed( ifd, ExifInterface.TAG_EXIF_IFD ) ) {
return; short tid = tag.getTagId(); int ifd = tag.getIfd(); if( tid == TAG_EXIF_IFD && checkAllowed( ifd, ExifInterface.TAG_EXIF_IFD ) ) {