Exiv2/exiv2

Preview cannot be read from an EPS file

Opened this issue · 0 comments

Describe the bug

Trying to read the embedded preview from an EPS file (attached) using exiv2 0.28.3. Exiv2 fails when reading metadata, although Windows and Linux (with Gnome) can show the preview of the file in default file managers.

The file itself was created with Adobe Illustrator, there's actually nothing special about it, except that exiv2 chokes on it.

The error is "Cannot read image data" and it produces a warning on the background with text "Warning: Page at position 190753 conflicts with implicit page at position: 9831"

To Reproduce

    Exiv2::Image::UniquePtr image = Exiv2::ImageFactory::open(filepath);
    image->readMetadata(); // <- it fails here

    Exiv2::PreviewManager pm(*image);
    Exiv2::PreviewPropertiesList list = pm.getPreviewProperties();
    // .... rest of the code from standard example

Expected behavior

EPS can be parsed, together with the preview.

Desktop (please complete the following information):

  • OS and version: Linux (Ubuntu 22.04), Windows 10 and 11
  • Exiv2 version and source: 0.28.3 from GitHub
  • Compiler and version: g++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
  • Compilation mode and/or compiler flags: Debug or Release, nothing special.

Additional context

There are 2 files in the archive (GitHub does not allow attaching EPS directly). I have about 6 such files, if needed.

Test_files.zip