注意:所有类型图像文件中,只有JPEG具有Exif信息
package com.uap.test;import java.io.ByteArrayOutputStream;import java.io.FileInputStream;import java.io.FileNotFoundException;import java.io.IOException;import java.lang.reflect.Field;import java.lang.reflect.Modifier;import java.util.Arrays;import java.util.HashMap;import java.util.Map;import org.json.JSONException;import org.json.JSONObject;import okhttp3.MediaType;import okhttp3.OkHttpClient;import okhttp3.Request;import okhttp3.RequestBody;import okhttp3.Response;public class JpegDecodeTest { public static byte[] getJPEGBytes(String filename) { FileInputStream fis = null; try { fis = new FileInputStream(filename); int available = fis.available(); ByteArrayOutputStream baos = new ByteArrayOutputStream(available); int len = -1; byte[] buf = new byte[1028]; while ((len=fis.read(buf, 0, buf.length))!=-1) { baos.write(buf, 0, len); } return baos.toByteArray(); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); }finally{ if(fis!=null) { try { fis.close(); } catch (IOException e) { } } } return null; } public static void main(String[] args) throws JSONException, IOException { byte[] buf = getJPEGBytes("ttt.png"); for (int i = 0; i < buf.length; i++) { int b = buf[i]&0xff; if(i>0 &&buf[i-1]==-1) { String s = null; switch (b) { case 0xD8: s = "SOI"; break; case 0xDB: s = "DQT"; showJPEGDHQ(buf,i); break; case 0xE0: { s = "APP0"; showJPEGApp0(buf,i); } break; case 0xC0: s = "SOF0"; showJPEGSOF0(buf,i); break; case 0xC4: s = "DHT"; break; case 0xDD: s = "DRI"; break; case 0xDA: s = "SOS"; break; case 0xD9: s = "EOI"; break; default: { int H = (int)(b&0xff); if(H>=0xE1 && 0xEF>=H) { s = "APPE"+(H-225+1); showJPEGAppH(buf, i); } } break; } if(s!=null) { System.out.println(" FIND-Flag: "+s); } } } } private static void showJPEGDHQ(byte[] buf, int i) { if(buf==null || buf.length<=i) { return; } int startIndex = i+1; int len = getByteToInteger(buf, startIndex, 2, true); System.out.println("DHQ长度:"+len); } private static void showJPEGSOF0(byte[] buf, int i) { if(buf==null || buf.length<=i) { return; } int startIndex = i+1; int len = getByteToInteger(buf, startIndex, 2, true); System.out.println("App0长度:"+len); byte[] sof0Buf = new byte[len]; System.arraycopy(buf, startIndex, sof0Buf, 0, len); startIndex = 0; startIndex = startIndex + 2; int degree = sof0Buf[startIndex]&0XFF; //精度 int width = getByteToInteger(sof0Buf, startIndex+1, 2, true); int height = getByteToInteger(sof0Buf, startIndex+3, 2, true); int xyDelta = sof0Buf[startIndex+5]&0XFF; //颜色分量 startIndex = startIndex + 6; int restLen = len - startIndex; } private static void showJPEGApp0(byte[] buf, int i) { if(buf==null || buf.length<=i) { return; } int startIndex = i+1; int len = getByteToInteger(buf, startIndex, 2, true); System.out.println("App0长度:"+len); startIndex = startIndex +2; String flag = getStrings(buf, startIndex, 5).trim(); System.out.println("flag:"+flag); if("JFIF".equalsIgnoreCase(flag)) { startIndex = startIndex+5; String version = (buf[startIndex]&0xFF) +"."+(buf[startIndex+1]&0xFF); System.out.println("version="+version); startIndex = startIndex +2; int densityUnit = buf[startIndex]&0xFF; //像素单位 int XDensity = getByteToInteger(buf, startIndex+1, 2, true); int YDensity = getByteToInteger(buf, startIndex+3, 2, true); startIndex = startIndex +5; String XYPixesBlockNumbers = (buf[startIndex]&0xFF) +"/"+(buf[startIndex+1]&0xFF); startIndex = startIndex +2; System.out.println("densityUnit="+densityUnit+", XDensity="+XDensity+", YDensity="+YDensity+", XYPixesBlockNumbers="+XYPixesBlockNumbers); int rest = len - (startIndex-i-1); if("0/0".equals(XYPixesBlockNumbers) || rest==0) { System.out.println("没有缩略图位图!"); }else{ byte[] bmpBytes = new byte[rest]; System.arraycopy(buf, startIndex, bmpBytes, 0, rest); System.out.println("RGB位图大小:"+bmpBytes.length); } } } private static void showJPEGAppH(byte[] buf, int i) throws IOException { if(buf==null || buf.length<=i) { return; } int len = getByteToInteger(buf, i+1, 2, true); System.out.println("本段长度:"+len); byte[] appbuf = new byte[len]; System.arraycopy(buf, i+1, appbuf, 0, len); int k = 2; String strIfExif = getStrings(appbuf, k, 4); if("Exif".equalsIgnoreCase(strIfExif)) { int iTIFFOffset = k + 4; //大小端保存问题,占4个字节 int bytesToInt = getByteToInteger(appbuf, iTIFFOffset, 4, true); boolean isBigEndian = false; if(bytesToInt==0x4949) { //小端模式 isBigEndian = false; }else if(bytesToInt==0x4D4D){ //大端模式 isBigEndian = true; }else{ System.out.println("Not valid TIFF data! (no 0x4949 or 0x4D4D)"); return; } if(isBigEndian) { System.out.println("大端模式"); iTIFFOffset = iTIFFOffset + 4; int checkNumber = getByteToInteger(appbuf, iTIFFOffset, 2, isBigEndian); System.out.println("checkNumber="+checkNumber); boolean isValidExif = true; if(checkNumber!=0x002A){ isValidExif = false; System.out.println("Not valid TIFF data! (no 0x002A)"); return; } iTIFFOffset = iTIFFOffset + 2; checkNumber = getByteToInteger(appbuf, iTIFFOffset, 4,isBigEndian); System.out.println("checkNumber="+checkNumber); if (checkNumber!= 0x0008) { isValidExif = false; System.out.println("Not valid TIFF data! (First offset not 8)"); return; } Mapmap = readTagInfo(Exif.TiffTags.class, appbuf, iTIFFOffset,iTIFFOffset+4, isBigEndian); if(map.containsKey("ExifIFDPointer")) { int ExifIFDPointerOffset = (int) map.get("ExifIFDPointer")+iTIFFOffset-4; System.out.println(ExifIFDPointerOffset); Map readTagInfo = readTagInfo(Exif.Tags.class, appbuf, iTIFFOffset,ExifIFDPointerOffset, isBigEndian); map.putAll(readTagInfo); } if (map.containsKey("GPSInfoIFDPointer")) { int GPSInfoIFDPointer = (int) map.get("GPSInfoIFDPointer")+iTIFFOffset-4; System.out.println(GPSInfoIFDPointer); Map readTagInfo = readTagInfo(Exif.GPSTags.class, appbuf, iTIFFOffset,GPSInfoIFDPointer, isBigEndian); map.putAll(readTagInfo); } System.out.println(map); }else{ System.out.println("小端模式"); } }else{ strIfExif = new String(buf, i,len); System.out.println(strIfExif); } } private static Map readTagInfo(Class clazz, byte[] appbuf, int iTIFFOffset,int startDir, boolean isBigEndian) { int iEntries = getByteToInteger(appbuf, startDir, 2, isBigEndian); Map map = new HashMap (); for (int t=0;t 4 ? iValueOffset : (iEntryOffset + 8); String[] aVals = new String[iNumValues]; for (int n=0;n 4?iValueOffset : (iEntryOffset + 8); value = getStrings(appbuf,iStringOffset,iNumValues-1); break; case 3: { if (iNumValues == 1) { value = getByteToInteger(appbuf, iEntryOffset+8, 4, true); } else if(iNumValues >= 2){ int iValOffset = iNumValues > 2 ? iValueOffset : (iEntryOffset + 8); String[] aVals = new String[iNumValues]; for (int n=0;n
辅助类
package com.uap.test;import java.io.*;public class Exif { public static Tag createTag(int id, String name) { return new Tag(id, name); } public interface Tags { public static final Tag Tag_ExifVersion = Exif.createTag(0x9000, "ExifVersion"); // EXIFversion public static final Tag Tag_FlashpixVersion = Exif.createTag(0xA000, "FlashpixVersion"); // Flashpixformatversion public static final Tag Tag_ColorSpace = Exif.createTag(0xA001, "ColorSpace"); // Colorspaceinformationtag public static final Tag Tag_PixelXDimension = Exif.createTag(0xA002, "PixelXDimension"); // Validwidthofmeaningfulimage public static final Tag Tag_PixelYDimension = Exif.createTag(0xA003, "PixelYDimension"); // Validheightofmeaningfulimage public static final Tag Tag_ComponentsConfiguration = Exif.createTag(0x9101, "ComponentsConfiguration"); // Informationaboutchannels public static final Tag Tag_CompressedBitsPerPixel = Exif.createTag(0x9102, "CompressedBitsPerPixel"); // Compressedbitsperpixel public static final Tag Tag_MakerNote = Exif.createTag(0x927C, "MakerNote"); // Anydesiredinformationwrittenbythemanufacturer public static final Tag Tag_UserComment = Exif.createTag(0x9286, "UserComment"); // Commentsbyuser public static final Tag Tag_RelatedSoundFile = Exif.createTag(0xA004, "RelatedSoundFile"); // Nameofrelatedsoundfile public static final Tag Tag_DateTimeOriginal = Exif.createTag(0x9003, "DateTimeOriginal"); // Dateandtimewhentheoriginalimagewasgenerated public static final Tag Tag_DateTimeDigitized = Exif.createTag(0x9004, "DateTimeDigitized"); // Dateandtimewhentheimagewasstoreddigitally public static final Tag Tag_SubsecTime = Exif.createTag(0x9290, "SubsecTime"); // FractionsofsecondsforDateTime public static final Tag Tag_SubsecTimeOriginal = Exif.createTag(0x9291, "SubsecTimeOriginal"); // FractionsofsecondsforDateTimeOriginal public static final Tag Tag_SubsecTimeDigitized = Exif.createTag(0x9292, "SubsecTimeDigitized"); // FractionsofsecondsforDateTimeDigitized public static final Tag Tag_ExposureTime = Exif.createTag(0x829A, "ExposureTime"); // Exposuretime(inseconds) public static final Tag Tag_FNumber = Exif.createTag(0x829D, "FNumber"); // Fnumber public static final Tag Tag_ExposureProgram = Exif.createTag(0x8822, "ExposureProgram"); // Exposureprogram public static final Tag Tag_SpectralSensitivity = Exif.createTag(0x8824, "SpectralSensitivity"); // Spectralsensitivity public static final Tag Tag_ISOSpeedRatings = Exif.createTag(0x8827, "ISOSpeedRatings"); // ISOspeedrating public static final Tag Tag_OECF = Exif.createTag(0x8828, "OECF"); // Optoelectricconversionfactor public static final Tag Tag_ShutterSpeedValue = Exif.createTag(0x9201, "ShutterSpeedValue"); // Shutterspeed public static final Tag Tag_ApertureValue = Exif.createTag(0x9202, "ApertureValue"); // Lensaperture public static final Tag Tag_BrightnessValue = Exif.createTag(0x9203, "BrightnessValue"); // Valueofbrightness public static final Tag Tag_ExposureBias = Exif.createTag(0x9204, "ExposureBias"); // Exposurebias public static final Tag Tag_MaxApertureValue = Exif.createTag(0x9205, "MaxApertureValue"); // SmallestFnumberoflens public static final Tag Tag_SubjectDistance = Exif.createTag(0x9206, "SubjectDistance"); // Distancetosubjectinmeters public static final Tag Tag_MeteringMode = Exif.createTag(0x9207, "MeteringMode"); // Meteringmode public static final Tag Tag_LightSource = Exif.createTag(0x9208, "LightSource"); // Kindoflightsource public static final Tag Tag_Flash = Exif.createTag(0x9209, "Flash"); // Flashstatus public static final Tag Tag_SubjectArea = Exif.createTag(0x9214, "SubjectArea"); // Locationandareaofmainsubject public static final Tag Tag_FocalLength = Exif.createTag(0x920A, "FocalLength"); // Focallengthofthelensinmm public static final Tag Tag_FlashEnergy = Exif.createTag(0xA20B, "FlashEnergy"); // StrobeenergyinBCPS public static final Tag Tag_SpatialFrequencyResponse = Exif.createTag(0xA20C, "SpatialFrequencyResponse"); public static final Tag Tag_FocalPlaneXResolution = Exif.createTag(0xA20E, "FocalPlaneXResolution"); // NumberofpixelsinwidthdirectionperFocalPlaneResolutionUnit public static final Tag Tag_FocalPlaneYResolution = Exif.createTag(0xA20F, "FocalPlaneYResolution"); // NumberofpixelsinheightdirectionperFocalPlaneResolutionUnit public static final Tag Tag_FocalPlaneResolutionUnit = Exif.createTag(0xA210, "FocalPlaneResolutionUnit"); // UnitformeasuringFocalPlaneXResolutionandFocalPlaneYResolution public static final Tag Tag_SubjectLocation = Exif.createTag(0xA214, "SubjectLocation"); // Locationofsubjectinimage public static final Tag Tag_ExposureIndex = Exif.createTag(0xA215, "ExposureIndex"); // Exposureindexselectedoncamera public static final Tag Tag_SensingMethod = Exif.createTag(0xA217, "SensingMethod"); // Imagesensortype public static final Tag Tag_FileSource = Exif.createTag(0xA300, "FileSource"); // Imagesource(3DSC) public static final Tag Tag_SceneType = Exif.createTag(0xA301, "SceneType"); // Scenetype(1directlyphotographed) public static final Tag Tag_CFAPattern = Exif.createTag(0xA302, "CFAPattern"); // Colorfilterarraygeometricpattern public static final Tag Tag_CustomRendered = Exif.createTag(0xA401, "CustomRendered"); // Specialprocessing public static final Tag Tag_ExposureMode = Exif.createTag(0xA402, "ExposureMode"); // Exposuremode public static final Tag Tag_WhiteBalance = Exif.createTag(0xA403, "WhiteBalance"); // 1autowhitebalance,2manual public static final Tag Tag_DigitalZoomRation = Exif.createTag(0xA404, "DigitalZoomRation"); // Digitalzoomratio public static final Tag Tag_FocalLengthIn35mmFilm = Exif.createTag(0xA405, "FocalLengthIn35mmFilm"); // Equivalentfoacllengthassuming35mmfilmcamera(inmm) public static final Tag Tag_SceneCaptureType = Exif.createTag(0xA406, "SceneCaptureType"); // Typeofscene public static final Tag Tag_GainControl = Exif.createTag(0xA407, "GainControl"); // Degreeofoverallimagegainadjustment public static final Tag Tag_Contrast = Exif.createTag(0xA408, "Contrast"); // Directionofcontrastprocessingappliedbycamera public static final Tag Tag_Saturation = Exif.createTag(0xA409, "Saturation"); // Directionofsaturationprocessingappliedbycamera public static final Tag Tag_Sharpness = Exif.createTag(0xA40A, "Sharpness"); // Directionofsharpnessprocessingappliedbycamera public static final Tag Tag_DeviceSettingDescription = Exif.createTag(0xA40B, "DeviceSettingDescription"); public static final Tag Tag_SubjectDistanceRange = Exif.createTag(0xA40C, "SubjectDistanceRange"); // Distancetosubject public static final Tag Tag_InteroperabilityIFDPointer = Exif.createTag(0xA005, "InteroperabilityIFDPointer"); public static final Tag Tag_ImageUniqueID = Exif.createTag(0xA420, "ImageUniqueID"); // Identifierassigneduniquelytoeachimage } public interface TiffTags { public static final Tag Tag_ImageWidth = Exif.createTag(0x0100, "ImageWidth"); public static final Tag Tag_ImageHeight = Exif.createTag(0x0101, "ImageHeight"); public static final Tag Tag_ExifIFDPointer = Exif.createTag(0x8769, "ExifIFDPointer"); public static final Tag Tag_GPSInfoIFDPointer = Exif.createTag(0x8825, "GPSInfoIFDPointer"); public static final Tag Tag_InteroperabilityIFDPointer = Exif.createTag(0xA005, "InteroperabilityIFDPointer"); public static final Tag Tag_BitsPerSample = Exif.createTag(0x0102, "BitsPerSample"); public static final Tag Tag_Compression = Exif.createTag(0x0103, "Compression"); public static final Tag Tag_PhotometricInterpretation = Exif.createTag(0x0106, "PhotometricInterpretation"); public static final Tag Tag_Orientation = Exif.createTag(0x0112, "Orientation"); public static final Tag Tag_SamplesPerPixel = Exif.createTag(0x0115, "SamplesPerPixel"); public static final Tag Tag_PlanarConfiguration = Exif.createTag(0x011C, "PlanarConfiguration"); public static final Tag Tag_YCbCrSubSampling = Exif.createTag(0x0212, "YCbCrSubSampling"); public static final Tag Tag_YCbCrPositioning = Exif.createTag(0x0213, "YCbCrPositioning"); public static final Tag Tag_XResolution = Exif.createTag(0x011A, "XResolution"); public static final Tag Tag_YResolution = Exif.createTag(0x011B, "YResolution"); public static final Tag Tag_ResolutionUnit = Exif.createTag(0x0128, "ResolutionUnit"); public static final Tag Tag_StripOffsets = Exif.createTag(0x0111, "StripOffsets"); public static final Tag Tag_RowsPerStrip = Exif.createTag(0x0116, "RowsPerStrip"); public static final Tag Tag_StripByteCounts = Exif.createTag(0x0117, "StripByteCounts"); public static final Tag Tag_JPEGInterchangeFormat = Exif.createTag(0x0201, "JPEGInterchangeFormat"); public static final Tag Tag_JPEGInterchangeFormatLength = Exif.createTag(0x0202, "JPEGInterchangeFormatLength"); public static final Tag Tag_TransferFunction = Exif.createTag(0x012D, "TransferFunction"); public static final Tag Tag_WhitePoint = Exif.createTag(0x013E, "WhitePoint"); public static final Tag Tag_PrimaryChromaticities = Exif.createTag(0x013F, "PrimaryChromaticities"); public static final Tag Tag_YCbCrCoefficients = Exif.createTag(0x0211, "YCbCrCoefficients"); public static final Tag Tag_ReferenceBlackWhite = Exif.createTag(0x0214, "ReferenceBlackWhite"); public static final Tag Tag_DateTime = Exif.createTag(0x0132, "DateTime"); public static final Tag Tag_ImageDescription = Exif.createTag(0x010E, "ImageDescription"); public static final Tag Tag_Make = Exif.createTag(0x010F, "Make"); public static final Tag Tag_Model = Exif.createTag(0x0110, "Model"); public static final Tag Tag_Software = Exif.createTag(0x0131, "Software"); public static final Tag Tag_Artist = Exif.createTag(0x013B, "Artist"); public static final Tag Tag_Copyright = Exif.createTag(0x8298, "Copyright"); } public interface GPSTags { public static final Tag Tag_GPSVersionID = Exif.createTag(0x0000, "GPSVersionID"); public static final Tag Tag_GPSLatitudeRef = Exif.createTag(0x0001, "GPSLatitudeRef"); public static final Tag Tag_GPSLatitude = Exif.createTag(0x0002, "GPSLatitude"); public static final Tag Tag_GPSLongitudeRef = Exif.createTag(0x0003, "GPSLongitudeRef"); public static final Tag Tag_GPSLongitude = Exif.createTag(0x0004, "GPSLongitude"); public static final Tag Tag_GPSAltitudeRef = Exif.createTag(0x0005, "GPSAltitudeRef"); public static final Tag Tag_GPSAltitude = Exif.createTag(0x0006, "GPSAltitude"); public static final Tag Tag_GPSTimeStamp = Exif.createTag(0x0007, "GPSTimeStamp"); public static final Tag Tag_GPSSatellites = Exif.createTag(0x0008, "GPSSatellites"); public static final Tag Tag_GPSStatus = Exif.createTag(0x0009, "GPSStatus"); public static final Tag Tag_GPSMeasureMode = Exif.createTag(0x000A, "GPSMeasureMode"); public static final Tag Tag_GPSDOP = Exif.createTag(0x000B, "GPSDOP"); public static final Tag Tag_GPSSpeedRef = Exif.createTag(0x000C, "GPSSpeedRef"); public static final Tag Tag_GPSSpeed = Exif.createTag(0x000D, "GPSSpeed"); public static final Tag Tag_GPSTrackRef = Exif.createTag(0x000E, "GPSTrackRef"); public static final Tag Tag_GPSTrack = Exif.createTag(0x000F, "GPSTrack"); public static final Tag Tag_GPSImgDirectionRef = Exif.createTag(0x0010, "GPSImgDirectionRef"); public static final Tag Tag_GPSImgDirection = Exif.createTag(0x0011, "GPSImgDirection"); public static final Tag Tag_GPSMapDatum = Exif.createTag(0x0012, "GPSMapDatum"); public static final Tag Tag_GPSDestLatitudeRef = Exif.createTag(0x0013, "GPSDestLatitudeRef"); public static final Tag Tag_GPSDestLatitude = Exif.createTag(0x0014, "GPSDestLatitude"); public static final Tag Tag_GPSDestLongitudeRef = Exif.createTag(0x0015, "GPSDestLongitudeRef"); public static final Tag Tag_GPSDestLongitude = Exif.createTag(0x0016, "GPSDestLongitude"); public static final Tag Tag_GPSDestBearingRef = Exif.createTag(0x0017, "GPSDestBearingRef"); public static final Tag Tag_GPSDestBearing = Exif.createTag(0x0018, "GPSDestBearing"); public static final Tag Tag_GPSDestDistanceRef = Exif.createTag(0x0019, "GPSDestDistanceRef"); public static final Tag Tag_GPSDestDistance = Exif.createTag(0x001A, "GPSDestDistance"); public static final Tag Tag_GPSProcessingMethod = Exif.createTag(0x001B, "GPSProcessingMethod"); public static final Tag Tag_GPSAreaInformation = Exif.createTag(0x001C, "GPSAreaInformation"); public static final Tag Tag_GPSDateStamp = Exif.createTag(0x001D, "GPSDateStamp"); public static final Tag Tag_GPSDifferential = Exif.createTag(0x001E, "GPSDifferential"); } public interface StringValues { public interface ExposureProgram { public static final Tag Tag_Notdefined = Exif.createTag(0, "Notdefined"); public static final Tag Tag_Manual = Exif.createTag(1, "Manual"); public static final Tag Tag_Normalprogram = Exif.createTag(2, "Normalprogram"); public static final Tag Tag_Aperturepriority = Exif.createTag(3, "Aperturepriority"); public static final Tag Tag_Shutterpriority = Exif.createTag(4, "Shutterpriority"); public static final Tag Tag_Creativeprogram = Exif.createTag(5, "Creativeprogram"); public static final Tag Tag_Actionprogram = Exif.createTag(6, "Actionprogram"); public static final Tag Tag_Portraitmode = Exif.createTag(7, "Portraitmode"); public static final Tag Tag_Landscapemode = Exif.createTag(8, "Landscapemode"); } public interface MeteringMode { public static final Tag Tag_Unknown = Exif.createTag(0, "Unknown"); public static final Tag Tag_Average = Exif.createTag(1, "Average"); public static final Tag Tag_CenterWeightedAverage = Exif.createTag(2, "CenterWeightedAverage"); public static final Tag Tag_Spot = Exif.createTag(3, "Spot"); public static final Tag Tag_MultiSpot = Exif.createTag(4, "MultiSpot"); public static final Tag Tag_Pattern = Exif.createTag(5, "Pattern"); public static final Tag Tag_Partial = Exif.createTag(6, "Partial"); public static final Tag Tag_Other = Exif.createTag(255, "Other"); } public interface LightSource { public static final Tag Tag_Unknown = Exif.createTag(0, "Unknown"); public static final Tag Tag_Daylight = Exif.createTag(1, "Daylight"); public static final Tag Tag_Fluorescent = Exif.createTag(2, "Fluorescent"); public static final Tag Tag_Tungstenincandescentlight = Exif.createTag(3, "Tungstenincandescentlight"); public static final Tag Tag_Flash = Exif.createTag(4, "Flash"); public static final Tag Tag_Fineweather = Exif.createTag(9, "Fineweather"); public static final Tag Tag_Cloudyweather = Exif.createTag(10, "Cloudyweather"); public static final Tag Tag_Shade = Exif.createTag(11, "Shade"); public static final Tag Tag_DaylightfluorescentD57007100K = Exif.createTag(12, "DaylightfluorescentD57007100K"); public static final Tag Tag_DaywhitefluorescentN46005400K = Exif.createTag(13, "DaywhitefluorescentN46005400K"); public static final Tag Tag_CoolwhitefluorescentW39004500K = Exif.createTag(14, "CoolwhitefluorescentW39004500K"); public static final Tag Tag_WhitefluorescentWW32003700K = Exif.createTag(15, "WhitefluorescentWW32003700K"); public static final Tag Tag_StandardlightA = Exif.createTag(17, "StandardlightA"); public static final Tag Tag_StandardlightB = Exif.createTag(18, "StandardlightB"); public static final Tag Tag_StandardlightC = Exif.createTag(19, "StandardlightC"); public static final Tag Tag_D55 = Exif.createTag(20, "D55"); public static final Tag Tag_D65 = Exif.createTag(21, "D65"); public static final Tag Tag_D75 = Exif.createTag(22, "D75"); public static final Tag Tag_D50 = Exif.createTag(23, "D50"); public static final Tag Tag_ISOstudiotungsten = Exif.createTag(24, "ISOstudiotungsten"); public static final Tag Tag_Other = Exif.createTag(255, "Other"); } public interface Flash { public static final Tag Tag_Flashdidnotfire = Exif.createTag(0x0000, "Flashdidnotfire"); public static final Tag Tag_Flashfired = Exif.createTag(0x0001, "Flashfired"); public static final Tag Tag_Strobereturnlightnotdetected = Exif.createTag(0x0005, "Strobereturnlightnotdetected"); public static final Tag Tag_Strobereturnlightdetected = Exif.createTag(0x0007, "Strobereturnlightdetected"); public static final Tag Tag_Flashfiredcompulsoryflashmode = Exif.createTag(0x0009, "Flashfiredcompulsoryflashmode"); public static final Tag Tag_Flashfiredcompulsoryflashmodereturnlightnotdetected = Exif.createTag(0x000D, "Flashfiredcompulsoryflashmodereturnlightnotdetected"); public static final Tag Tag_Flashfiredcompulsoryflashmodereturnlightdetected = Exif.createTag(0x000F, "Flashfiredcompulsoryflashmodereturnlightdetected"); public static final Tag Tag_Flashdidnotfirecompulsoryflashmode = Exif.createTag(0x0010, "Flashdidnotfirecompulsoryflashmode"); public static final Tag Tag_Flashdidnotfireautomode = Exif.createTag(0x0018, "Flashdidnotfireautomode"); public static final Tag Tag_Flashfiredautomode = Exif.createTag(0x0019, "Flashfiredautomode"); public static final Tag Tag_Flashfiredautomodereturnlightnotdetected = Exif.createTag(0x001D, "Flashfiredautomodereturnlightnotdetected"); public static final Tag Tag_Flashfiredautomodereturnlightdetected = Exif.createTag(0x001F, "Flashfiredautomodereturnlightdetected"); public static final Tag Tag_Noflashfunction = Exif.createTag(0x0020, "Noflashfunction"); public static final Tag Tag_Flashfiredredeyereductionmode = Exif.createTag(0x0041, "Flashfiredredeyereductionmode"); public static final Tag Tag_Flashfiredredeyereductionmodereturnlightnotdetected = Exif.createTag(0x0045, "Flashfiredredeyereductionmodereturnlightnotdetected"); public static final Tag Tag_Flashfiredredeyereductionmodereturnlightdetected = Exif.createTag(0x0047, "Flashfiredredeyereductionmodereturnlightdetected"); public static final Tag Tag_Flashfiredcompulsoryflashmoderedeyereductionmode = Exif.createTag(0x0049, "Flashfiredcompulsoryflashmoderedeyereductionmode"); public static final Tag Tag_Flashfiredcompulsoryflashmoderedeyereductionmodereturnlightnotdetected = Exif .createTag(0x004D, "Flashfiredcompulsoryflashmoderedeyereductionmodereturnlightnotdetected"); public static final Tag Tag_Flashfiredcompulsoryflashmoderedeyereductionmodereturnlightdetected = Exif .createTag(0x004F, "Flashfiredcompulsoryflashmoderedeyereductionmodereturnlightdetected"); public static final Tag Tag_Flashfiredautomoderedeyereductionmode = Exif.createTag(0x0059, "Flashfiredautomoderedeyereductionmode"); public static final Tag Tag_Flashfiredautomodereturnlightnotdetectedredeyereductionmode = Exif .createTag(0x005D, "Flashfiredautomodereturnlightnotdetectedredeyereductionmode"); public static final Tag Tag_Flashfiredautomodereturnlightdetectedredeyereductionmode = Exif .createTag(0x005F, "Flashfiredautomodereturnlightdetectedredeyereductionmode"); } public interface SensingMethod { public static final Tag Tag_Notdefined = Exif.createTag(1, "Notdefined"); public static final Tag Tag_Onechipcolorareasensor = Exif.createTag(2, "Onechipcolorareasensor"); public static final Tag Tag_Twochipcolorareasensor = Exif.createTag(3, "Twochipcolorareasensor"); public static final Tag Tag_Threechipcolorareasensor = Exif.createTag(4, "Threechipcolorareasensor"); public static final Tag Tag_Colorsequentialareasensor = Exif.createTag(5, "Colorsequentialareasensor"); public static final Tag Tag_Trilinearsensor = Exif.createTag(7, "Trilinearsensor"); public static final Tag Tag_Colorsequentiallinearsensor = Exif.createTag(8, "Colorsequentiallinearsensor"); } public interface SceneCaptureType { public static final Tag Tag_Standard = Exif.createTag(0, "Standard"); public static final Tag Tag_Landscape = Exif.createTag(1, "Landscape"); public static final Tag Tag_Portrait = Exif.createTag(2, "Portrait"); public static final Tag Tag_Nightscene = Exif.createTag(3, "Nightscene"); } public interface SceneType { public static final Tag Tag_Directlyphotographed = Exif.createTag(1, "Directlyphotographed"); } public interface CustomRendered { public static final Tag Tag_Normalprocess = Exif.createTag(0, "Normalprocess"); public static final Tag Tag_Customprocess = Exif.createTag(1, "Customprocess"); } public interface WhiteBalance { public static final Tag Tag_Autowhitebalance = Exif.createTag(0, "Autowhitebalance"); public static final Tag Tag_Manualwhitebalance = Exif.createTag(1, "Manualwhitebalance"); } public interface GainControl { public static final Tag Tag_None = Exif.createTag(0, "None"); public static final Tag Tag_Lowgainup = Exif.createTag(1, "Lowgainup"); public static final Tag Tag_Highgainup = Exif.createTag(2, "Highgainup"); public static final Tag Tag_Lowgaindown = Exif.createTag(3, "Lowgaindown"); public static final Tag Tag_Highgaindown = Exif.createTag(4, "Highgaindown"); } public interface Contrast { public static final Tag Tag_Normal = Exif.createTag(0, "Normal"); public static final Tag Tag_Soft = Exif.createTag(1, "Soft"); public static final Tag Tag_Hard = Exif.createTag(2, "Hard"); } public interface Saturation { public static final Tag Tag_Normal = Exif.createTag(0, "Normal"); public static final Tag Tag_Lowsaturation = Exif.createTag(1, "Lowsaturation"); public static final Tag Tag_Highsaturation = Exif.createTag(2, "Highsaturation"); } public interface Sharpness { public static final Tag Tag_Normal = Exif.createTag(0, "Normal"); public static final Tag Tag_Soft = Exif.createTag(1, "Soft"); public static final Tag Tag_Hard = Exif.createTag(2, "Hard"); } public interface SubjectDistanceRange { public static final Tag Tag_Unknown = Exif.createTag(0, "Unknown"); public static final Tag Tag_Macro = Exif.createTag(1, "Macro"); public static final Tag Tag_Closeview = Exif.createTag(2, "Closeview"); public static final Tag Tag_Distantview = Exif.createTag(3, "Distantview"); } public interface FileSource { public static final Tag Tag_DSC = Exif.createTag(3, "DSC"); } public interface Components { public static final Tag Tag_ = Exif.createTag(0, ""); public static final Tag Tag_Y = Exif.createTag(1, "Y"); public static final Tag Tag_Cb = Exif.createTag(2, "Cb"); public static final Tag Tag_Cr = Exif.createTag(3, "Cr"); public static final Tag Tag_R = Exif.createTag(4, "R"); public static final Tag Tag_G = Exif.createTag(5, "G"); public static final Tag Tag_B = Exif.createTag(6, "B"); } }}