Ignore:
Timestamp:
2016-08-20T20:58:03+02:00 (9 years ago)
Author:
Don-vip
Message:

update to metadata-extractor 2.9.1

File:
1 edited

Legend:

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

    r8132 r10862  
    11/*
    2  * Copyright 2002-2015 Drew Noakes
     2 * Copyright 2002-2016 Drew Noakes
    33 *
    44 *    Licensed under the Apache License, Version 2.0 (the "License");
     
    2525import com.drew.metadata.TagDescriptor;
    2626
     27import static com.drew.metadata.jpeg.JpegDirectory.*;
     28
    2729/**
    2830 * Provides human-readable string versions of the tags stored in a JpegDirectory.
     
    4446        switch (tagType)
    4547        {
    46             case JpegDirectory.TAG_COMPRESSION_TYPE:
     48            case TAG_COMPRESSION_TYPE:
    4749                return getImageCompressionTypeDescription();
    48             case JpegDirectory.TAG_COMPONENT_DATA_1:
     50            case TAG_COMPONENT_DATA_1:
    4951                return getComponentDataDescription(0);
    50             case JpegDirectory.TAG_COMPONENT_DATA_2:
     52            case TAG_COMPONENT_DATA_2:
    5153                return getComponentDataDescription(1);
    52             case JpegDirectory.TAG_COMPONENT_DATA_3:
     54            case TAG_COMPONENT_DATA_3:
    5355                return getComponentDataDescription(2);
    54             case JpegDirectory.TAG_COMPONENT_DATA_4:
     56            case TAG_COMPONENT_DATA_4:
    5557                return getComponentDataDescription(3);
    56             case JpegDirectory.TAG_DATA_PRECISION:
     58            case TAG_DATA_PRECISION:
    5759                return getDataPrecisionDescription();
    58             case JpegDirectory.TAG_IMAGE_HEIGHT:
     60            case TAG_IMAGE_HEIGHT:
    5961                return getImageHeightDescription();
    60             case JpegDirectory.TAG_IMAGE_WIDTH:
     62            case TAG_IMAGE_WIDTH:
    6163                return getImageWidthDescription();
    6264            default:
     
    6870    public String getImageCompressionTypeDescription()
    6971    {
    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");
    9289    }
     90
    9391    @Nullable
    9492    public String getImageWidthDescription()
    9593    {
    96         final String value = _directory.getString(JpegDirectory.TAG_IMAGE_WIDTH);
     94        final String value = _directory.getString(TAG_IMAGE_WIDTH);
    9795        if (value==null)
    9896            return null;
     
    103101    public String getImageHeightDescription()
    104102    {
    105         final String value = _directory.getString(JpegDirectory.TAG_IMAGE_HEIGHT);
     103        final String value = _directory.getString(TAG_IMAGE_HEIGHT);
    106104        if (value==null)
    107105            return null;
     
    112110    public String getDataPrecisionDescription()
    113111    {
    114         final String value = _directory.getString(JpegDirectory.TAG_DATA_PRECISION);
     112        final String value = _directory.getString(TAG_DATA_PRECISION);
    115113        if (value==null)
    116114            return null;
Note: See TracChangeset for help on using the changeset viewer.