break;
case JExifTag.EXIFTAG_TAG_CHANGEDATETIME:
if ((date = JIfdData.getDateFromString(data.getChangeDateTime())) != null)
{
strBuf = new StringBuffer();
Main.m_shortDayOfWeekFormat.format(date, strBuf, new FieldPosition(0));
obj = strBuf + ", " + DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT).format(date);
}
else obj = "";
break;
case JExifTag.EXIFTAG_TAG_ARTIST:
obj = data.getArtist();
break;
case JExifTag.EXIFTAG_TAG_DESCRIPTION:
obj = data.getDescription();
break;
case JExifTag.EXIFTAG_TAG_YCBCRPOSITION:
obj = Main.getString(String.format("data_ycbcrposition_0x%1$04X", data.getYCbCrPosition()));
break;
case JExifTag.EXIFTAG_TAG_COPYRIGHT:
obj = data.getCopyright();
break;
case JExifTag.EXIFTAG_TAG_EXPOSURETIME:
data.getExposureTime(str);
obj = str[0];
break;
case JExifTag.EXIFTAG_TAG_FNUMBER:
data.getFNumber(str);
obj = str[0];
break;
case JExifTag.EXIFTAG_TAG_EXPOSUREPROGRAM:
try
{
obj = Main.getString(String.format("data_exposureprogram_0x%1$04X", data.getExposureProgram()));
}
catch(MissingResourceException ex)
{
obj = Main.getString("data_exposureprogram_reserved");
}
break;
case JExifTag.EXIFTAG_TAG_ISOSPEEDRATINGS:
obj = data.getISOSpeedRatings();
break;
case JExifTag.EXIFTAG_TAG_EXIFVERSION:
obj = data.getExifVersion();
break;
case JExifTag.EXIFTAG_TAG_ORIGINALDATETIME:
if ((date = JIfdData.getDateFromString(data.getOriginalDateTime())) != null)
{
strBuf = new StringBuffer();
Main.m_shortDayOfWeekFormat.format(date, strBuf, new FieldPosition(0));
obj = strBuf + ", " + DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT).format(date);
}
else obj = "";
break;
case JExifTag.EXIFTAG_TAG_DIGITIZEDDATETIME:
if ((date = JIfdData.getDateFromString(data.getDigitizedDateTime())) != null)
{
strBuf = new StringBuffer();
Main.m_shortDayOfWeekFormat.format(date, strBuf, new FieldPosition(0));
obj = strBuf + ", " + DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT).format(date);
}
else obj = "";
break;
case JExifTag.EXIFTAG_TAG_COMPONENTSCCONFIG:
obj = data.getComponentsConfig();
break;
case JExifTag.EXIFTAG_TAG_COMPRESSEDPITSPERPIXEL:
obj = data.getCompressedBitsPerPixel();
break;
case JExifTag.EXIFTAG_TAG_SHUTERSPEEDVALUE:
obj = data.getShuterSpeedValue();
break;
case JExifTag.EXIFTAG_TAG_APERTUREVALUE:
obj = data.getApertureValue();
break;
case JExifTag.EXIFTAG_TAG_BRIGHTNESSVALUE:
obj = data.getBrightnessValue();
break;
case JExifTag.EXIFTAG_TAG_EXPOSUREBIASVALUE:
obj = data.getExposureBiasValue();
break;
case JExifTag.EXIFTAG_TAG_MAXAPERTUREVALUE:
obj = data.getMaxApertureValue();
break;
case JExifTag.EXIFTAG_TAG_METERINGMODE:
try
{
obj = Main.getString(String.format("data_meteringmode_0x%1$04X", data.getMeteringMode()));
}
catch(MissingResourceException ex)
{
obj = Main.getString("data_meteringmode_reserved");
}
break;
case JExifTag.EXIFTAG_TAG_LIGHTSOURCE:
try
{
obj = Main.getString(String.format("data_lightsource_0x%1$04X", data.getLightSource()));
}
catch(MissingResourceException ex)
{
obj = Main.getString("data_lightsource_reserved");
}
break;
case JExifTag.EXIFTAG_TAG_FLASH:
h = data.getFlash();
if ((h & 0x01) != 0)
{
str[0] = Main.getString(String.format("data_flash_yes"));
if (((h & 0x06) >> 1) == 0x02)
str[0] += ", " + Main.getString("data_flash_strobereturnnotdetected");
else if (((h & 0x06) >> 1) == 0x03)
str[0] += ", " + Main.getString("data_flash_strobereturndetected");
if (((h & 0x18) >> 3) == 0)
str[0] += ", " + Main.getString("data_flash_modeunknown");
else if (((h & 0x18) >> 3) == 0x01)
str[0] += ", " + Main.getString("data_flash_modecompulsory");
else if (((h & 0x18) >> 3) == 0x03)
str[0] += ", " + Main.getString("data_flash_modeauto");
if ((h & 0x40) != 0)
str[0] += ", " + Main.getString("data_flash_moderedeyereduction");
}
else
{
if ((h & 0x20) != 0)
{
str[0] = Main.getString(String.format("data_flash_notavailable"));
}
else
{
str[0] = Main.getString(String.format("data_flash_no"));
if (((h & 0x18) >> 3) == 0x01)
str[0] += ", " + Main.getString("data_flash_modecompulsorysuppression");
}
}
obj = str[0];
break;
case JExifTag.EXIFTAG_TAG_FOCALLENGTH:
obj = data.getFocalLength();
break;
case JExifTag.EXIFTAG_TAG_COLORSPACE:
obj = Main.getString(String.format("data_colorspace_0x%1$04X", data.getColorSpace()));
break;
case JExifTag.EXIFTAG_TAG_SIZE:
obj = String.format("%1$dx%2$d", data.getPixelXDimension(), data.getPixelYDimension());
break;
case JExifTag.EXIFTAG_TAG_FOCALPLANERESOLUTION:
obj = String.format("%1$.1f/%3$s x %2$.1f/%3$s", data.getFocalPlaneXResolution(), data.getFocalPlaneYResolution(), Main.getString(String.format("data_unit_0x%1$04X", data.getFocalPlaneResolutionUnit())));
break;
case JExifTag.EXIFTAG_TAG_SENSINGMODE:
obj = Main.getString(String.format("data_sensingmode_0x%1$04X", data.getSensingMode()));
break;
case JExifTag.EXIFTAG_TAG_CUSTOMRENDERED:
obj = Main.getString(String.format("data_customrendered_0x%1$04X", data.getCustomRendered()));
break;
case JExifTag.EXIFTAG_TAG_EXPOSUREMODE:
obj = Main.getString(String.format("data_exposuremode_0x%1$04X", data.getExposureMode()));
break;
case JExifTag.EXIFTAG_TAG_WHITEBALANCE:
obj = Main.getString(String.format("data_whitebalance_0x%1$04X", data.getWhiteBalance()));
break;
case JExifTag.EXIFTAG_TAG_DIGITALZOOMRATIO:
obj = data.getDigitalZoomRatio();
break;
case JExifTag.EXIFTAG_TAG_FOCALLENGTH35MM:
obj = data.getFocalLength35mm();
break;
case JExifTag.EXIFTAG_TAG_SCENECAPTURETYPE:
obj = Main.getString(String.format("data_scenecapturetype_0x%1$04X", data.getSceneCaptureType()));
break;
case JExifTag.EXIFTAG_TAG_SCENETYPE:
obj = Main.getString(String.format("data_scenetype_0x%1$04X", data.getSceneType()));
break;
case JExifTag.EXIFTAG_TAG_GAINCONTROL:
obj = Main.getString(String.format("data_gaincontrol_0x%1$04X", data.getGainControl()));
break;
case JExifTag.EXIFTAG_TAG_CONTRAST:
obj = Main.getString(String.format("data_contrast_0x%1$04X", data.getContrast()));
break;
case JExifTag.EXIFTAG_TAG_SATURATION:
obj = Main.getString(String.format("data_saturation_0x%1$04X", data.getSaturation()));
break;
case JExifTag.EXIFTAG_TAG_SHARPNESS:
obj = Main.getString(String.format("data_sharpness_0x%1$04X", data.getSharpness()));
break;
case JExifTag.EXIFTAG_TAG_SUBJECTDISTANCERANGE:
obj = Main.getString(String.format("data_subjectdistancerange_0x%1$04X", data.getSubjectDistanceRange()));
break;
case JExifTag.EXIFTAG_TAG_FILESIZE:
StringBuilder strBuilder = new StringBuilder();
if (data.getFileSize() < 1024)
strBuilder.append(Long.toString(data.getFileSize()));
else if (data.getFileSize() < 1024*1024)
{
strBuilder.append(String.format("%1$.1f ", (float)data.getFileSize()/1024.0f));
strBuilder.append(Main.getString("KByte"));
}
else if (data.getFileSize() < 1024*1024*1024)
{
strBuilder.append(String.format("%1$.2f ", (float)data.getFileSize()/(1024.0f*1024.0f)));
strBuilder.append(Main.getString("MByte"));
}
obj = strBuilder.toString();
break;
case JExifTag.EXIFTAG_TAG_FILEDATETIME:
if ((date = data.getFileDate()) != null)
{
strBuf = new StringBuffer();
Main.m_shortDayOfWeekFormat.format(date, strBuf, new FieldPosition(0));
obj = strBuf + ", " + DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT).format(date);
}
else obj = "";
break;
case JExifTag.EXIFTAG_TAG_FILESOURCE:
obj = Main.getString(String.format("data_filesource_0x%1$04X", data.getFileSource()));
break;
// GPS stuff
case JExifTag.GPSTAG_TAG_VERSIONID:
obj = data.getGPSVersionID();
break;
case JExifTag.GPSTAG_TAG_LATITUDE:
obj = String.format("%.6f° %s", data.getGPSLatitude(), Main.getString(String.format("data_gps_latituderef_%s", data.getGPSLatitudeRef())));
break;
case JExifTag.GPSTAG_TAG_LONGITUDE:
obj = String.format("%.6f° %s", data.getGPSLongitude(), Main.getString(String.format("data_gps_longituderef_%s", data.getGPSLongitudeRef())));
break;
case JExifTag.GPSTAG_TAG_ALTITUDE:
int ref = data.getGPSAltitudeRef();
if (ref>=0)
ref = ref != 0 ? -1 : 1;
else throw new MissingResourceException(null, null, null);
float f = data.getGPSAltitude();
if (Float.isNaN(f))
throw new MissingResourceException(null, null, null);
else
obj = String.format("%.1f m", ref*f, Main.getString("data_gps_altitude_unit"));
break;
case JExifTag.GPSTAG_TAG_TIMESTAMP:
strBuf = new StringBuffer();
date = data.getGPSTimestamp();
if (date != null)
{
Main.m_shortDayOfWeekFormat.format(date, strBuf, new FieldPosition(0));
obj = strBuf + ", " + DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT).format(date);
}
else obj = null;
case JExifTag.GPSTAG_TAG_SATELLITES:
obj = data.getGPSSatellites();