| 1 | /*
|
|---|
| 2 | * Copyright 2002-2012 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 | * http://drewnoakes.com/code/exif/
|
|---|
| 19 | * http://code.google.com/p/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 http://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 | public static final int TAG_YCBCR_COEFFICIENTS = 0x0211;
|
|---|
| 49 | public static final int TAG_YCBCR_POSITIONING = 0x0213;
|
|---|
| 50 | public static final int TAG_REFERENCE_BLACK_WHITE = 0x0214;
|
|---|
| 51 | public static final int TAG_COPYRIGHT = 0x8298;
|
|---|
| 52 |
|
|---|
| 53 | /** The image title, as used by Windows XP. */
|
|---|
| 54 | public static final int TAG_WIN_TITLE = 0x9C9B;
|
|---|
| 55 | /** The image comment, as used by Windows XP. */
|
|---|
| 56 | public static final int TAG_WIN_COMMENT = 0x9C9C;
|
|---|
| 57 | /** The image author, as used by Windows XP (called Artist in the Windows shell). */
|
|---|
| 58 | public static final int TAG_WIN_AUTHOR = 0x9C9D;
|
|---|
| 59 | /** The image keywords, as used by Windows XP. */
|
|---|
| 60 | public static final int TAG_WIN_KEYWORDS = 0x9C9E;
|
|---|
| 61 | /** The image subject, as used by Windows XP. */
|
|---|
| 62 | public static final int TAG_WIN_SUBJECT = 0x9C9F;
|
|---|
| 63 |
|
|---|
| 64 | @NotNull
|
|---|
| 65 | protected static final HashMap<Integer, String> _tagNameMap = new HashMap<Integer, String>();
|
|---|
| 66 |
|
|---|
| 67 | static
|
|---|
| 68 | {
|
|---|
| 69 | _tagNameMap.put(TAG_IMAGE_DESCRIPTION, "Image Description");
|
|---|
| 70 | _tagNameMap.put(TAG_MAKE, "Make");
|
|---|
| 71 | _tagNameMap.put(TAG_MODEL, "Model");
|
|---|
| 72 | _tagNameMap.put(TAG_ORIENTATION, "Orientation");
|
|---|
| 73 | _tagNameMap.put(TAG_X_RESOLUTION, "X Resolution");
|
|---|
| 74 | _tagNameMap.put(TAG_Y_RESOLUTION, "Y Resolution");
|
|---|
| 75 | _tagNameMap.put(TAG_RESOLUTION_UNIT, "Resolution Unit");
|
|---|
| 76 | _tagNameMap.put(TAG_SOFTWARE, "Software");
|
|---|
| 77 | _tagNameMap.put(TAG_DATETIME, "Date/Time");
|
|---|
| 78 | _tagNameMap.put(TAG_ARTIST, "Artist");
|
|---|
| 79 | _tagNameMap.put(TAG_WHITE_POINT, "White Point");
|
|---|
| 80 | _tagNameMap.put(TAG_PRIMARY_CHROMATICITIES, "Primary Chromaticities");
|
|---|
| 81 | _tagNameMap.put(TAG_YCBCR_COEFFICIENTS, "YCbCr Coefficients");
|
|---|
| 82 | _tagNameMap.put(TAG_YCBCR_POSITIONING, "YCbCr Positioning");
|
|---|
| 83 | _tagNameMap.put(TAG_REFERENCE_BLACK_WHITE, "Reference Black/White");
|
|---|
| 84 | _tagNameMap.put(TAG_COPYRIGHT, "Copyright");
|
|---|
| 85 |
|
|---|
| 86 | _tagNameMap.put(TAG_WIN_AUTHOR, "Windows XP Author");
|
|---|
| 87 | _tagNameMap.put(TAG_WIN_COMMENT, "Windows XP Comment");
|
|---|
| 88 | _tagNameMap.put(TAG_WIN_KEYWORDS, "Windows XP Keywords");
|
|---|
| 89 | _tagNameMap.put(TAG_WIN_SUBJECT, "Windows XP Subject");
|
|---|
| 90 | _tagNameMap.put(TAG_WIN_TITLE, "Windows XP Title");
|
|---|
| 91 | }
|
|---|
| 92 |
|
|---|
| 93 | public ExifIFD0Directory()
|
|---|
| 94 | {
|
|---|
| 95 | this.setDescriptor(new ExifIFD0Descriptor(this));
|
|---|
| 96 | }
|
|---|
| 97 |
|
|---|
| 98 | @NotNull
|
|---|
| 99 | public String getName()
|
|---|
| 100 | {
|
|---|
| 101 | return "Exif IFD0";
|
|---|
| 102 | }
|
|---|
| 103 |
|
|---|
| 104 | @NotNull
|
|---|
| 105 | protected HashMap<Integer, String> getTagNameMap()
|
|---|
| 106 | {
|
|---|
| 107 | return _tagNameMap;
|
|---|
| 108 | }
|
|---|
| 109 | }
|
|---|