| 1 | /*
|
|---|
| 2 | * Copyright 2002-2015 Drew Noakes
|
|---|
| 3 | *
|
|---|
| 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
|---|
| 5 | * you may not use this file except in compliance with the License.
|
|---|
| 6 | * You may obtain a copy of the License at
|
|---|
| 7 | *
|
|---|
| 8 | * http://www.apache.org/licenses/LICENSE-2.0
|
|---|
| 9 | *
|
|---|
| 10 | * Unless required by applicable law or agreed to in writing, software
|
|---|
| 11 | * distributed under the License is distributed on an "AS IS" BASIS,
|
|---|
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|---|
| 13 | * See the License for the specific language governing permissions and
|
|---|
| 14 | * limitations under the License.
|
|---|
| 15 | *
|
|---|
| 16 | * More information about this project is available at:
|
|---|
| 17 | *
|
|---|
| 18 | * https://drewnoakes.com/code/exif/
|
|---|
| 19 | * https://github.com/drewnoakes/metadata-extractor
|
|---|
| 20 | */
|
|---|
| 21 |
|
|---|
| 22 | package com.drew.metadata.exif;
|
|---|
| 23 |
|
|---|
| 24 | import com.drew.lang.annotations.NotNull;
|
|---|
| 25 | import com.drew.metadata.Directory;
|
|---|
| 26 |
|
|---|
| 27 | import java.util.HashMap;
|
|---|
| 28 |
|
|---|
| 29 | /**
|
|---|
| 30 | * Describes Exif tags from the IFD0 directory.
|
|---|
| 31 | *
|
|---|
| 32 | * @author Drew Noakes https://drewnoakes.com
|
|---|
| 33 | */
|
|---|
| 34 | public class ExifIFD0Directory extends Directory
|
|---|
| 35 | {
|
|---|
| 36 | public static final int TAG_IMAGE_DESCRIPTION = 0x010E;
|
|---|
| 37 | public static final int TAG_MAKE = 0x010F;
|
|---|
| 38 | public static final int TAG_MODEL = 0x0110;
|
|---|
| 39 | public static final int TAG_ORIENTATION = 0x0112;
|
|---|
| 40 | public static final int TAG_X_RESOLUTION = 0x011A;
|
|---|
| 41 | public static final int TAG_Y_RESOLUTION = 0x011B;
|
|---|
| 42 | public static final int TAG_RESOLUTION_UNIT = 0x0128;
|
|---|
| 43 | public static final int TAG_SOFTWARE = 0x0131;
|
|---|
| 44 | public static final int TAG_DATETIME = 0x0132;
|
|---|
| 45 | public static final int TAG_ARTIST = 0x013B;
|
|---|
| 46 | public static final int TAG_WHITE_POINT = 0x013E;
|
|---|
| 47 | public static final int TAG_PRIMARY_CHROMATICITIES = 0x013F;
|
|---|
| 48 |
|
|---|
| 49 | public static final int TAG_YCBCR_COEFFICIENTS = 0x0211;
|
|---|
| 50 | public static final int TAG_YCBCR_POSITIONING = 0x0213;
|
|---|
| 51 | public static final int TAG_REFERENCE_BLACK_WHITE = 0x0214;
|
|---|
| 52 |
|
|---|
| 53 |
|
|---|
| 54 | /** This tag is a pointer to the Exif SubIFD. */
|
|---|
| 55 | public static final int TAG_EXIF_SUB_IFD_OFFSET = 0x8769;
|
|---|
| 56 |
|
|---|
| 57 | /** This tag is a pointer to the Exif GPS IFD. */
|
|---|
| 58 | public static final int TAG_GPS_INFO_OFFSET = 0x8825;
|
|---|
| 59 |
|
|---|
| 60 | public static final int TAG_COPYRIGHT = 0x8298;
|
|---|
| 61 |
|
|---|
| 62 | /** Non-standard, but in use. */
|
|---|
| 63 | public static final int TAG_TIME_ZONE_OFFSET = 0x882a;
|
|---|
| 64 |
|
|---|
| 65 | /** The image title, as used by Windows XP. */
|
|---|
| 66 | public static final int TAG_WIN_TITLE = 0x9C9B;
|
|---|
| 67 | /** The image comment, as used by Windows XP. */
|
|---|
| 68 | public static final int TAG_WIN_COMMENT = 0x9C9C;
|
|---|
| 69 | /** The image author, as used by Windows XP (called Artist in the Windows shell). */
|
|---|
| 70 | public static final int TAG_WIN_AUTHOR = 0x9C9D;
|
|---|
| 71 | /** The image keywords, as used by Windows XP. */
|
|---|
| 72 | public static final int TAG_WIN_KEYWORDS = 0x9C9E;
|
|---|
| 73 | /** The image subject, as used by Windows XP. */
|
|---|
| 74 | public static final int TAG_WIN_SUBJECT = 0x9C9F;
|
|---|
| 75 |
|
|---|
| 76 | @NotNull
|
|---|
| 77 | protected static final HashMap<Integer, String> _tagNameMap = new HashMap<Integer, String>();
|
|---|
| 78 |
|
|---|
| 79 | static
|
|---|
| 80 | {
|
|---|
| 81 | _tagNameMap.put(TAG_IMAGE_DESCRIPTION, "Image Description");
|
|---|
| 82 | _tagNameMap.put(TAG_MAKE, "Make");
|
|---|
| 83 | _tagNameMap.put(TAG_MODEL, "Model");
|
|---|
| 84 | _tagNameMap.put(TAG_ORIENTATION, "Orientation");
|
|---|
| 85 | _tagNameMap.put(TAG_X_RESOLUTION, "X Resolution");
|
|---|
| 86 | _tagNameMap.put(TAG_Y_RESOLUTION, "Y Resolution");
|
|---|
| 87 | _tagNameMap.put(TAG_RESOLUTION_UNIT, "Resolution Unit");
|
|---|
| 88 | _tagNameMap.put(TAG_SOFTWARE, "Software");
|
|---|
| 89 | _tagNameMap.put(TAG_DATETIME, "Date/Time");
|
|---|
| 90 | _tagNameMap.put(TAG_ARTIST, "Artist");
|
|---|
| 91 | _tagNameMap.put(TAG_WHITE_POINT, "White Point");
|
|---|
| 92 | _tagNameMap.put(TAG_PRIMARY_CHROMATICITIES, "Primary Chromaticities");
|
|---|
| 93 | _tagNameMap.put(TAG_YCBCR_COEFFICIENTS, "YCbCr Coefficients");
|
|---|
| 94 | _tagNameMap.put(TAG_YCBCR_POSITIONING, "YCbCr Positioning");
|
|---|
| 95 | _tagNameMap.put(TAG_REFERENCE_BLACK_WHITE, "Reference Black/White");
|
|---|
| 96 |
|
|---|
| 97 | _tagNameMap.put(TAG_COPYRIGHT, "Copyright");
|
|---|
| 98 |
|
|---|
| 99 | _tagNameMap.put(TAG_TIME_ZONE_OFFSET, "Time Zone Offset");
|
|---|
| 100 |
|
|---|
| 101 | _tagNameMap.put(TAG_WIN_AUTHOR, "Windows XP Author");
|
|---|
| 102 | _tagNameMap.put(TAG_WIN_COMMENT, "Windows XP Comment");
|
|---|
| 103 | _tagNameMap.put(TAG_WIN_KEYWORDS, "Windows XP Keywords");
|
|---|
| 104 | _tagNameMap.put(TAG_WIN_SUBJECT, "Windows XP Subject");
|
|---|
| 105 | _tagNameMap.put(TAG_WIN_TITLE, "Windows XP Title");
|
|---|
| 106 | }
|
|---|
| 107 |
|
|---|
| 108 | public ExifIFD0Directory()
|
|---|
| 109 | {
|
|---|
| 110 | this.setDescriptor(new ExifIFD0Descriptor(this));
|
|---|
| 111 | }
|
|---|
| 112 |
|
|---|
| 113 | @Override
|
|---|
| 114 | @NotNull
|
|---|
| 115 | public String getName()
|
|---|
| 116 | {
|
|---|
| 117 | return "Exif IFD0";
|
|---|
| 118 | }
|
|---|
| 119 |
|
|---|
| 120 | @Override
|
|---|
| 121 | @NotNull
|
|---|
| 122 | protected HashMap<Integer, String> getTagNameMap()
|
|---|
| 123 | {
|
|---|
| 124 | return _tagNameMap;
|
|---|
| 125 | }
|
|---|
| 126 | }
|
|---|