Bug #790

XMP embedding corrupts CorelDRAW EPS files

Added by Volker Grabsch over 5 years ago. Updated almost 5 years ago.

Status:ClosedStart date:30 Sep 2011
Priority:UrgentDue date:
Assignee:Volker Grabsch% Done:

100%

Category:image format
Target version:0.23

Description

When XMP is embedded into an EPS file generated by CorelDRAW, the resulting EPS file is corrupt and won't open. As of Exiv2 0.22, the only workaround is removing the XMP via "exiv2 -dx".

This issue exists with all CorelDRAW versions from 11 to X5, and possibly also with older versions of CorelDRAW. The resulting file can't be opened with any application, because the problem happens at the level of PostScript code.

Note that this issue is very different from the issue with Illustrator-8 EPS files, where only one application (Illustrator) wasn't able to open the modified EPS file, but all other applications worked perfectly fine with it.

The problem is caused by CorelDRAW's somewhat strange interpretation of the DSC specification. Usually, the PostScript code after %%EndPageSetup leaves the stack in the same state as it started. However, in CorelDRAW's code the first effective PostScript command is "restore" (called by "@rs" called by "@rax"). This works only well if the last command of PageSetup was "@sv" (which calls "save"). However, this is exactly where our XMP embedding code is inserted, in conformance with the XMP specification. So the "restore" undoes some definition of our XMP embedding which leads to an "undefined" error later in the second part of the XMP embedding code (at %%PageTrailer).

In simpler words, the CorelDRAW EPS code expects the last command of %%PageSetup to be "@sv", otherwise it won't work properly.

I think we can improve our embedding code to add some workaround for the special case of CorelDRAW EPS files.

Associated revisions

Revision 2619
Added by Volker Grabsch over 5 years ago

#790: Added workaround for EPS files generated by CorelDRAW

History

#1 Updated by Volker Grabsch over 5 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

I fixed this issue and added some test EPS files generated by CorelDRAW. (r2619)

#2 Updated by Andreas Huggel almost 5 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF

Redmine Appliance - Powered by TurnKey Linux