protected ExifTag buildUninitializedTag( int tagId ) { int info = getTagInfo().get( tagId ); if( info == 0 ) { return null; } short type = getTypeFromInfo( info ); int definedCount = getComponentCountFromInfo( info ); boolean hasDefinedCount = ( definedCount != ExifTag.SIZE_UNDEFINED ); int ifdId = getTrueIfd( tagId ); return new ExifTag( getTrueTagKey( tagId ), type, definedCount, ifdId, hasDefinedCount ); }
protected ExifTag buildUninitializedTag( int tagId ) { int info = getTagInfo().get( tagId ); if( info == 0 ) { return null; } short type = getTypeFromInfo( info ); int definedCount = getComponentCountFromInfo( info ); boolean hasDefinedCount = ( definedCount != ExifTag.SIZE_UNDEFINED ); int ifdId = getTrueIfd( tagId ); return new ExifTag( getTrueTagKey( tagId ), type, definedCount, ifdId, hasDefinedCount ); }
/** * Creates a tag for a defined tag constant in a given IFD if that IFD is * allowed for the tag. This method will fail anytime the appropriate * {@link ExifTag#setValue} for this tag's datatype would fail. * * @param tagId a tag constant, e.g. {@link #TAG_IMAGE_WIDTH}. * @param ifdId the IFD that the tag should be in. * @param val the value of the tag to set. * @return an ExifTag object or null if one could not be constructed. * @see #buildTag */ public ExifTag buildTag( int tagId, int ifdId, Object val ) { int info = getTagInfo().get( tagId ); if( info == 0 || val == null ) { return null; } short type = getTypeFromInfo( info ); int definedCount = getComponentCountFromInfo( info ); boolean hasDefinedCount = ( definedCount != ExifTag.SIZE_UNDEFINED ); if( ! ExifInterface.isIfdAllowed( info, ifdId ) ) { return null; } ExifTag t = new ExifTag( getTrueTagKey( tagId ), type, definedCount, ifdId, hasDefinedCount ); if( ! t.setValue( val ) ) { return null; } return t; }
/** * Creates a tag for a defined tag constant in a given IFD if that IFD is * allowed for the tag. This method will fail anytime the appropriate * {@link ExifTag#setValue} for this tag's datatype would fail. * * @param tagId a tag constant, e.g. {@link #TAG_IMAGE_WIDTH}. * @param ifdId the IFD that the tag should be in. * @param val the value of the tag to set. * @return an ExifTag object or null if one could not be constructed. * @see #buildTag */ public ExifTag buildTag( int tagId, int ifdId, Object val ) { int info = getTagInfo().get( tagId ); if( info == 0 || val == null ) { return null; } short type = getTypeFromInfo( info ); int definedCount = getComponentCountFromInfo( info ); boolean hasDefinedCount = ( definedCount != ExifTag.SIZE_UNDEFINED ); if( ! ExifInterface.isIfdAllowed( info, ifdId ) ) { return null; } ExifTag t = new ExifTag( getTrueTagKey( tagId ), type, definedCount, ifdId, hasDefinedCount ); if( ! t.setValue( val ) ) { return null; } return t; }
ExifTag tag = new ExifTag( tagId, dataFormat, (int) numOfComp, mIfdType, ( (int) numOfComp ) != ExifTag.SIZE_UNDEFINED ); int dataSize = tag.getDataSize(); if( dataSize > 4 ) {
ExifTag tag = new ExifTag( tagId, dataFormat, (int) numOfComp, mIfdType, ( (int) numOfComp ) != ExifTag.SIZE_UNDEFINED ); int dataSize = tag.getDataSize(); if( dataSize > 4 ) {