Changeset 10862 in josm for trunk/src/com/drew/metadata/jpeg/JpegDescriptor.java
- Timestamp:
- 2016-08-20T20:58:03+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/com/drew/metadata/jpeg/JpegDescriptor.java
r8132 r10862 1 1 /* 2 * Copyright 2002-201 5Drew Noakes2 * Copyright 2002-2016 Drew Noakes 3 3 * 4 4 * Licensed under the Apache License, Version 2.0 (the "License"); … … 25 25 import com.drew.metadata.TagDescriptor; 26 26 27 import static com.drew.metadata.jpeg.JpegDirectory.*; 28 27 29 /** 28 30 * Provides human-readable string versions of the tags stored in a JpegDirectory. … … 44 46 switch (tagType) 45 47 { 46 case JpegDirectory.TAG_COMPRESSION_TYPE:48 case TAG_COMPRESSION_TYPE: 47 49 return getImageCompressionTypeDescription(); 48 case JpegDirectory.TAG_COMPONENT_DATA_1:50 case TAG_COMPONENT_DATA_1: 49 51 return getComponentDataDescription(0); 50 case JpegDirectory.TAG_COMPONENT_DATA_2:52 case TAG_COMPONENT_DATA_2: 51 53 return getComponentDataDescription(1); 52 case JpegDirectory.TAG_COMPONENT_DATA_3:54 case TAG_COMPONENT_DATA_3: 53 55 return getComponentDataDescription(2); 54 case JpegDirectory.TAG_COMPONENT_DATA_4:56 case TAG_COMPONENT_DATA_4: 55 57 return getComponentDataDescription(3); 56 case JpegDirectory.TAG_DATA_PRECISION:58 case TAG_DATA_PRECISION: 57 59 return getDataPrecisionDescription(); 58 case JpegDirectory.TAG_IMAGE_HEIGHT:60 case TAG_IMAGE_HEIGHT: 59 61 return getImageHeightDescription(); 60 case JpegDirectory.TAG_IMAGE_WIDTH:62 case TAG_IMAGE_WIDTH: 61 63 return getImageWidthDescription(); 62 64 default: … … 68 70 public String getImageCompressionTypeDescription() 69 71 { 70 Integer value = _directory.getInteger(JpegDirectory.TAG_COMPRESSION_TYPE); 71 if (value==null) 72 return null; 73 // Note there is no 2 or 12 74 switch (value) { 75 case 0: return "Baseline"; 76 case 1: return "Extended sequential, Huffman"; 77 case 2: return "Progressive, Huffman"; 78 case 3: return "Lossless, Huffman"; 79 case 5: return "Differential sequential, Huffman"; 80 case 6: return "Differential progressive, Huffman"; 81 case 7: return "Differential lossless, Huffman"; 82 case 8: return "Reserved for JPEG extensions"; 83 case 9: return "Extended sequential, arithmetic"; 84 case 10: return "Progressive, arithmetic"; 85 case 11: return "Lossless, arithmetic"; 86 case 13: return "Differential sequential, arithmetic"; 87 case 14: return "Differential progressive, arithmetic"; 88 case 15: return "Differential lossless, arithmetic"; 89 default: 90 return "Unknown type: "+ value; 91 } 72 return getIndexedDescription(TAG_COMPRESSION_TYPE, 73 "Baseline", 74 "Extended sequential, Huffman", 75 "Progressive, Huffman", 76 "Lossless, Huffman", 77 null, // no 4 78 "Differential sequential, Huffman", 79 "Differential progressive, Huffman", 80 "Differential lossless, Huffman", 81 "Reserved for JPEG extensions", 82 "Extended sequential, arithmetic", 83 "Progressive, arithmetic", 84 "Lossless, arithmetic", 85 null, // no 12 86 "Differential sequential, arithmetic", 87 "Differential progressive, arithmetic", 88 "Differential lossless, arithmetic"); 92 89 } 90 93 91 @Nullable 94 92 public String getImageWidthDescription() 95 93 { 96 final String value = _directory.getString( JpegDirectory.TAG_IMAGE_WIDTH);94 final String value = _directory.getString(TAG_IMAGE_WIDTH); 97 95 if (value==null) 98 96 return null; … … 103 101 public String getImageHeightDescription() 104 102 { 105 final String value = _directory.getString( JpegDirectory.TAG_IMAGE_HEIGHT);103 final String value = _directory.getString(TAG_IMAGE_HEIGHT); 106 104 if (value==null) 107 105 return null; … … 112 110 public String getDataPrecisionDescription() 113 111 { 114 final String value = _directory.getString( JpegDirectory.TAG_DATA_PRECISION);112 final String value = _directory.getString(TAG_DATA_PRECISION); 115 113 if (value==null) 116 114 return null;
Note:
See TracChangeset
for help on using the changeset viewer.
