/** * Puts a collection of ExifTags into this ExifInterface objects's tags. Any * previous ExifTags with the same TID and IFDs will be removed. * * @param tags a Collection of ExifTags. * @see #setTag */ public void setTags( Collection<ExifTag> tags ) { if( null == tags ) return; for( ExifTag t : tags ) { setTag( t ); } }
/** * Puts a collection of ExifTags into this ExifInterface objects's tags. Any * previous ExifTags with the same TID and IFDs will be removed. * * @param tags a Collection of ExifTags. * @see #setTag */ public void setTags( Collection<ExifTag> tags ) { if( null == tags ) return; for( ExifTag t : tags ) { setTag( t ); } }
/** * Creates, formats, and sets the DateTimeStamp tag for one of: * {@link #TAG_DATE_TIME}, {@link #TAG_DATE_TIME_DIGITIZED}, * {@link #TAG_DATE_TIME_ORIGINAL}. * * @param tagId one of the DateTimeStamp tags. * @param timestamp a timestamp to format. * @param timezone a TimeZone object. * @return true if success, false if the tag could not be set. */ public boolean addDateTimeStampTag( int tagId, long timestamp, TimeZone timezone ) { if( tagId == TAG_DATE_TIME || tagId == TAG_DATE_TIME_DIGITIZED || tagId == TAG_DATE_TIME_ORIGINAL ) { mDateTimeStampFormat.setTimeZone( timezone ); ExifTag t = buildTag( tagId, mDateTimeStampFormat.format( timestamp ) ); if( t == null ) { return false; } setTag( t ); } else { return false; } return true; }
/** * Creates, formats, and sets the DateTimeStamp tag for one of: * {@link #TAG_DATE_TIME}, {@link #TAG_DATE_TIME_DIGITIZED}, * {@link #TAG_DATE_TIME_ORIGINAL}. * * @param tagId one of the DateTimeStamp tags. * @param timestamp a timestamp to format. * @param timezone a TimeZone object. * @return true if success, false if the tag could not be set. */ public boolean addDateTimeStampTag( int tagId, long timestamp, TimeZone timezone ) { if( tagId == TAG_DATE_TIME || tagId == TAG_DATE_TIME_DIGITIZED || tagId == TAG_DATE_TIME_ORIGINAL ) { mDateTimeStampFormat.setTimeZone( timezone ); ExifTag t = buildTag( tagId, mDateTimeStampFormat.format( timestamp ) ); if( t == null ) { return false; } setTag( t ); } else { return false; } return true; }
/** * Creates and sets all to the GPS tags for a give latitude and longitude. * * @param latitude a GPS latitude coordinate. * @param longitude a GPS longitude coordinate. * @return true if success, false if they could not be created or set. */ @SuppressWarnings( "unused" ) public boolean addGpsTags( double latitude, double longitude ) { ExifTag latTag = buildTag( TAG_GPS_LATITUDE, toExifLatLong( latitude ) ); ExifTag longTag = buildTag( TAG_GPS_LONGITUDE, toExifLatLong( longitude ) ); ExifTag latRefTag = buildTag( TAG_GPS_LATITUDE_REF, latitude >= 0 ? GpsLatitudeRef.NORTH : GpsLatitudeRef.SOUTH ); ExifTag longRefTag = buildTag( TAG_GPS_LONGITUDE_REF, longitude >= 0 ? GpsLongitudeRef.EAST : GpsLongitudeRef.WEST ); if( latTag == null || longTag == null || latRefTag == null || longRefTag == null ) { return false; } setTag( latTag ); setTag( longTag ); setTag( latRefTag ); setTag( longRefTag ); return true; }
/** * Creates and sets all to the GPS tags for a give latitude and longitude. * * @param latitude a GPS latitude coordinate. * @param longitude a GPS longitude coordinate. * @return true if success, false if they could not be created or set. */ @SuppressWarnings( "unused" ) public boolean addGpsTags( double latitude, double longitude ) { ExifTag latTag = buildTag( TAG_GPS_LATITUDE, toExifLatLong( latitude ) ); ExifTag longTag = buildTag( TAG_GPS_LONGITUDE, toExifLatLong( longitude ) ); ExifTag latRefTag = buildTag( TAG_GPS_LATITUDE_REF, latitude >= 0 ? GpsLatitudeRef.NORTH : GpsLatitudeRef.SOUTH ); ExifTag longRefTag = buildTag( TAG_GPS_LONGITUDE_REF, longitude >= 0 ? GpsLongitudeRef.EAST : GpsLongitudeRef.WEST ); if( latTag == null || longTag == null || latRefTag == null || longRefTag == null ) { return false; } setTag( latTag ); setTag( longTag ); setTag( latRefTag ); setTag( longRefTag ); return true; }
/** * Creates and sets the GPS timestamp tag. * * @param timestamp a GPS timestamp. * @return true if success, false if could not be created or set. */ @SuppressWarnings( "unused" ) public boolean addGpsDateTimeStampTag( long timestamp ) { ExifTag t = buildTag( TAG_GPS_DATE_STAMP, mGPSDateStampFormat.format( timestamp ) ); if( t == null ) { return false; } setTag( t ); mGPSTimeStampCalendar.setTimeInMillis( timestamp ); t = buildTag( TAG_GPS_TIME_STAMP, new Rational[]{ new Rational( mGPSTimeStampCalendar.get( Calendar.HOUR_OF_DAY ), 1 ), new Rational( mGPSTimeStampCalendar.get( Calendar.MINUTE ), 1 ), new Rational( mGPSTimeStampCalendar.get( Calendar.SECOND ), 1 ) } ); if( t == null ) { return false; } setTag( t ); return true; }
/** * Creates and sets the GPS timestamp tag. * * @param timestamp a GPS timestamp. * @return true if success, false if could not be created or set. */ @SuppressWarnings( "unused" ) public boolean addGpsDateTimeStampTag( long timestamp ) { ExifTag t = buildTag( TAG_GPS_DATE_STAMP, mGPSDateStampFormat.format( timestamp ) ); if( t == null ) { return false; } setTag( t ); mGPSTimeStampCalendar.setTimeInMillis( timestamp ); t = buildTag( TAG_GPS_TIME_STAMP, new Rational[]{ new Rational( mGPSTimeStampCalendar.get( Calendar.HOUR_OF_DAY ), 1 ), new Rational( mGPSTimeStampCalendar.get( Calendar.MINUTE ), 1 ), new Rational( mGPSTimeStampCalendar.get( Calendar.SECOND ), 1 ) } ); if( t == null ) { return false; } setTag( t ); return true; }