com.drew.imaging.eps.EpsMetadataReader 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
This is a fork of com.drewnoakes' metadata-extractor that relocates com.adobe.internal to com.adobe.
Java library for extracting EXIF, IPTC, XMP, ICC and other metadata from image and video files.
The newest version!
package com.drew.imaging.eps;
import com.drew.lang.annotations.NotNull;
import com.drew.metadata.Metadata;
import com.drew.metadata.eps.EpsReader;
import com.drew.metadata.file.FileSystemMetadataReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
/**
* Obtains metadata from EPS files.
*
* @author Payton Garland
*/
public class EpsMetadataReader {
@NotNull
public static Metadata readMetadata(@NotNull File file) throws IOException
{
Metadata metadata = new Metadata();
FileInputStream stream = new FileInputStream(file);
try {
new EpsReader().extract(stream, metadata);
} finally {
stream.close();
}
new FileSystemMetadataReader().read(file, metadata);
return metadata;
}
@NotNull
public static Metadata readMetadata(@NotNull InputStream inputStream) throws IOException
{
Metadata metadata = new Metadata();
new EpsReader().extract(inputStream, metadata);
return metadata;
}
}