Ignore:
Timestamp:
2015-03-10T01:17:39+01:00 (11 years ago)
Author:
Don-vip
Message:

fix #11162 - update to metadata-extractor 2.7.2

File:
1 edited

Legend:

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

    r6127 r8132  
    11/*
    2  * Copyright 2002-2012 Drew Noakes
     2 * Copyright 2002-2015 Drew Noakes
    33 *
    44 *    Licensed under the Apache License, Version 2.0 (the "License");
     
    1616 * More information about this project is available at:
    1717 *
    18  *    http://drewnoakes.com/code/exif/
    19  *    http://code.google.com/p/metadata-extractor/
     18 *    https://drewnoakes.com/code/exif/
     19 *    https://github.com/drewnoakes/metadata-extractor
    2020 */
    2121package com.drew.metadata.jpeg;
     
    2929
    3030/**
    31  * Directory of tags and values for the SOF0 Jpeg segment.  This segment holds basic metadata about the image.
     31 * Directory of tags and values for the SOF0 JPEG segment.  This segment holds basic metadata about the image.
    3232 *
    33  * @author Darrell Silver http://www.darrellsilver.com and Drew Noakes http://drewnoakes.com
     33 * @author Darrell Silver http://www.darrellsilver.com and Drew Noakes https://drewnoakes.com
    3434 */
    3535public class JpegDirectory extends Directory
    3636{
    37     public static final int TAG_JPEG_COMPRESSION_TYPE = -3;
     37    public static final int TAG_COMPRESSION_TYPE = -3;
    3838    /** This is in bits/sample, usually 8 (12 and 16 not supported by most software). */
    39     public static final int TAG_JPEG_DATA_PRECISION = 0;
     39    public static final int TAG_DATA_PRECISION = 0;
    4040    /** The image's height.  Necessary for decoding the image, so it should always be there. */
    41     public static final int TAG_JPEG_IMAGE_HEIGHT = 1;
     41    public static final int TAG_IMAGE_HEIGHT = 1;
    4242    /** The image's width.  Necessary for decoding the image, so it should always be there. */
    43     public static final int TAG_JPEG_IMAGE_WIDTH = 3;
     43    public static final int TAG_IMAGE_WIDTH = 3;
    4444    /**
    4545     * Usually 1 = grey scaled, 3 = color YcbCr or YIQ, 4 = color CMYK
     
    4848     * sampling factors (1byte) (bit 0-3 vertical., 4-7 horizontal.),
    4949     * quantization table number (1 byte).
    50      * <p/>
     50     * <p>
    5151     * This info is from http://www.funducode.com/freec/Fileformats/format3/format3b.htm
    5252     */
    53     public static final int TAG_JPEG_NUMBER_OF_COMPONENTS = 5;
     53    public static final int TAG_NUMBER_OF_COMPONENTS = 5;
    5454
    5555    // NOTE!  Component tag type int values must increment in steps of 1
    5656
    57     /** the first of a possible 4 color components.  Number of components specified in TAG_JPEG_NUMBER_OF_COMPONENTS. */
    58     public static final int TAG_JPEG_COMPONENT_DATA_1 = 6;
    59     /** the second of a possible 4 color components.  Number of components specified in TAG_JPEG_NUMBER_OF_COMPONENTS. */
    60     public static final int TAG_JPEG_COMPONENT_DATA_2 = 7;
    61     /** the third of a possible 4 color components.  Number of components specified in TAG_JPEG_NUMBER_OF_COMPONENTS. */
    62     public static final int TAG_JPEG_COMPONENT_DATA_3 = 8;
    63     /** the fourth of a possible 4 color components.  Number of components specified in TAG_JPEG_NUMBER_OF_COMPONENTS. */
    64     public static final int TAG_JPEG_COMPONENT_DATA_4 = 9;
     57    /** the first of a possible 4 color components.  Number of components specified in TAG_NUMBER_OF_COMPONENTS. */
     58    public static final int TAG_COMPONENT_DATA_1 = 6;
     59    /** the second of a possible 4 color components.  Number of components specified in TAG_NUMBER_OF_COMPONENTS. */
     60    public static final int TAG_COMPONENT_DATA_2 = 7;
     61    /** the third of a possible 4 color components.  Number of components specified in TAG_NUMBER_OF_COMPONENTS. */
     62    public static final int TAG_COMPONENT_DATA_3 = 8;
     63    /** the fourth of a possible 4 color components.  Number of components specified in TAG_NUMBER_OF_COMPONENTS. */
     64    public static final int TAG_COMPONENT_DATA_4 = 9;
    6565
    6666    @NotNull
     
    6868
    6969    static {
    70         _tagNameMap.put(TAG_JPEG_COMPRESSION_TYPE, "Compression Type");
    71         _tagNameMap.put(TAG_JPEG_DATA_PRECISION, "Data Precision");
    72         _tagNameMap.put(TAG_JPEG_IMAGE_WIDTH, "Image Width");
    73         _tagNameMap.put(TAG_JPEG_IMAGE_HEIGHT, "Image Height");
    74         _tagNameMap.put(TAG_JPEG_NUMBER_OF_COMPONENTS, "Number of Components");
    75         _tagNameMap.put(TAG_JPEG_COMPONENT_DATA_1, "Component 1");
    76         _tagNameMap.put(TAG_JPEG_COMPONENT_DATA_2, "Component 2");
    77         _tagNameMap.put(TAG_JPEG_COMPONENT_DATA_3, "Component 3");
    78         _tagNameMap.put(TAG_JPEG_COMPONENT_DATA_4, "Component 4");
     70        _tagNameMap.put(TAG_COMPRESSION_TYPE, "Compression Type");
     71        _tagNameMap.put(TAG_DATA_PRECISION, "Data Precision");
     72        _tagNameMap.put(TAG_IMAGE_WIDTH, "Image Width");
     73        _tagNameMap.put(TAG_IMAGE_HEIGHT, "Image Height");
     74        _tagNameMap.put(TAG_NUMBER_OF_COMPONENTS, "Number of Components");
     75        _tagNameMap.put(TAG_COMPONENT_DATA_1, "Component 1");
     76        _tagNameMap.put(TAG_COMPONENT_DATA_2, "Component 2");
     77        _tagNameMap.put(TAG_COMPONENT_DATA_3, "Component 3");
     78        _tagNameMap.put(TAG_COMPONENT_DATA_4, "Component 4");
    7979    }
    8080
     
    8484    }
    8585
     86    @Override
    8687    @NotNull
    8788    public String getName()
    8889    {
    89         return "Jpeg";
     90        return "JPEG";
    9091    }
    9192
     93    @Override
    9294    @NotNull
    9395    protected HashMap<Integer, String> getTagNameMap()
     
    104106    public JpegComponent getComponent(int componentNumber)
    105107    {
    106         int tagType = JpegDirectory.TAG_JPEG_COMPONENT_DATA_1 + componentNumber;
     108        int tagType = JpegDirectory.TAG_COMPONENT_DATA_1 + componentNumber;
    107109        return (JpegComponent)getObject(tagType);
    108110    }
     
    110112    public int getImageWidth() throws MetadataException
    111113    {
    112         return getInt(JpegDirectory.TAG_JPEG_IMAGE_WIDTH);
     114        return getInt(JpegDirectory.TAG_IMAGE_WIDTH);
    113115    }
    114116
    115117    public int getImageHeight() throws MetadataException
    116118    {
    117         return getInt(JpegDirectory.TAG_JPEG_IMAGE_HEIGHT);
     119        return getInt(JpegDirectory.TAG_IMAGE_HEIGHT);
    118120    }
    119121
    120122    public int getNumberOfComponents() throws MetadataException
    121123    {
    122         return getInt(JpegDirectory.TAG_JPEG_NUMBER_OF_COMPONENTS);
     124        return getInt(JpegDirectory.TAG_NUMBER_OF_COMPONENTS);
    123125    }
    124126}
Note: See TracChangeset for help on using the changeset viewer.