Ignore:
Timestamp:
2015-04-21T00:42:50+02:00 (10 years ago)
Author:
Don-vip
Message:

fix #11359 - update to metadata-extractor 2.8.1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/com/drew/metadata/jpeg/JpegReader.java

    r8132 r8243  
    6363    }
    6464
    65     public boolean canProcess(@NotNull byte[] segmentBytes, @NotNull JpegSegmentType segmentType)
     65    public void readJpegSegments(@NotNull Iterable<byte[]> segments, @NotNull Metadata metadata, @NotNull JpegSegmentType segmentType)
    6666    {
    67         return true;
     67        for (byte[] segmentBytes : segments) {
     68            extract(segmentBytes, metadata, segmentType);
     69        }
    6870    }
    6971
    70     public void extract(@NotNull byte[] segmentBytes, @NotNull Metadata metadata, @NotNull JpegSegmentType segmentType)
     72    public void extract(byte[] segmentBytes, Metadata metadata, JpegSegmentType segmentType)
    7173    {
    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);
    7976
    8077        // The value of TAG_COMPRESSION_TYPE is determined by the segment type found
     
    10198                directory.setObject(JpegDirectory.TAG_COMPONENT_DATA_1 + i, component);
    10299            }
    103 
    104100        } catch (IOException ex) {
    105101            directory.addError(ex.getMessage());
Note: See TracChangeset for help on using the changeset viewer.