com.drew.metadata.eps.EpsDescriptor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of metadata-extractor Show documentation
Show all versions of metadata-extractor Show documentation
Java library for extracting EXIF, IPTC, XMP, ICC and other metadata from image and video files.
package com.drew.metadata.eps;
import com.drew.lang.annotations.NotNull;
import com.drew.lang.annotations.Nullable;
import com.drew.metadata.TagDescriptor;
import static com.drew.metadata.eps.EpsDirectory.*;
/**
* @author Payton Garland
*/
public class EpsDescriptor extends TagDescriptor
{
public EpsDescriptor(@NotNull EpsDirectory directory)
{
super(directory);
}
@Override
public String getDescription(int tagType)
{
switch (tagType) {
case TAG_IMAGE_WIDTH:
case TAG_IMAGE_HEIGHT:
return getPixelDescription(tagType);
case TAG_TIFF_PREVIEW_SIZE:
case TAG_TIFF_PREVIEW_OFFSET:
return getByteSizeDescription(tagType);
case TAG_COLOR_TYPE:
return getColorTypeDescription();
default:
return _directory.getString(tagType);
}
}
public String getPixelDescription(int tagType)
{
return _directory.getString(tagType) + " pixels";
}
public String getByteSizeDescription(int tagType)
{
return _directory.getString(tagType) + " bytes";
}
@Nullable
public String getColorTypeDescription()
{
return getIndexedDescription(TAG_COLOR_TYPE, 1,
"Grayscale", "Lab", "RGB", "CMYK");
}
}