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
Java library for extracting EXIF, IPTC, XMP, ICC and other metadata from image and video files.
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;
}
}