Changeset 8243 in josm for trunk/src/com/drew/metadata/jpeg/JpegReader.java
- Timestamp:
- 2015-04-21T00:42:50+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/com/drew/metadata/jpeg/JpegReader.java
r8132 r8243 63 63 } 64 64 65 public boolean canProcess(@NotNull byte[] segmentBytes, @NotNull JpegSegmentType segmentType)65 public void readJpegSegments(@NotNull Iterable<byte[]> segments, @NotNull Metadata metadata, @NotNull JpegSegmentType segmentType) 66 66 { 67 return true; 67 for (byte[] segmentBytes : segments) { 68 extract(segmentBytes, metadata, segmentType); 69 } 68 70 } 69 71 70 public void extract( @NotNull byte[] segmentBytes, @NotNull Metadata metadata, @NotNullJpegSegmentType segmentType)72 public void extract(byte[] segmentBytes, Metadata metadata, JpegSegmentType segmentType) 71 73 { 72 if (metadata.containsDirectory(JpegDirectory.class)) { 73 // If this directory is already present, discontinue this operation. 74 // We only store metadata for the *first* matching SOFn segment. 75 return; 76 } 77 78 JpegDirectory directory = metadata.getOrCreateDirectory(JpegDirectory.class); 74 JpegDirectory directory = new JpegDirectory(); 75 metadata.addDirectory(directory); 79 76 80 77 // The value of TAG_COMPRESSION_TYPE is determined by the segment type found … … 101 98 directory.setObject(JpegDirectory.TAG_COMPONENT_DATA_1 + i, component); 102 99 } 103 104 100 } catch (IOException ex) { 105 101 directory.addError(ex.getMessage());
Note:
See TracChangeset
for help on using the changeset viewer.