Eps File corrupted after writing Metadata

Started by mariokrupik, November 01, 2010, 07:54:02 AM

Previous topic - Next topic

Phil Harvey

Attached is a simple script to remove the XMP totally from an EPS file.  You run it like this:

perl remove_xmp FILE

Where file is the name of one or more EPS files. (ie. perl remove_xmp *.eps to do all of them)

The script will generate a bunch of "_orig" files which are the backups of the files before this script was run.

I tested the script and it does what I wanted, but I can't verify that Illustrator will read the resulting file until I get home later today.  However, from the tests I ran yesterday I'm pretty confident that this should work.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

mariokrupik

Hi Phil,

thank you very much.
The script works fine on a single File, but doesn't work on more Files.
perl remove_xmp *.eps gives back error message "Error opening *.eps"
I am on Windows using the latest strawberry perl.


Phil Harvey

You're right.  Sorry.  I forgot that Windows doesn't expand wildcards on the command line like other shells.

I've added the necessary code to do this manually.  Attached is a new version (which should work provided you have the File::Glob library installed).

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

mariokrupik

#18
Awesome,

This works great.
But if I run the script through the whole library, my Files which have been created by corelDraw are going to be broken in Illustrator.

Now I added a few lines to the script, as only AI8 Files are affected by the xmp metadata:

EDIT: New remove_xmp is Attached

Thanks again Phil,
Mario

EDIT: I changed the code again, as the first Code rewrite deleted the Creator Tag.

Phil Harvey

Right.

The syntax is:

$buff =~ s/original string/replacement string/ to do a substitution.

or

$buff =~ /search string/ to test to see if a string exists

It seems you wanted to do the latter.  Doing it this way would have prevented loading the file again, but what you have done looks like it would get the job done.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Phil Harvey

Update:

I wasn't able to figure out how to fix the problem so that Illustrator would read one of these older EPS files after adding XMP with ExifTool.

As a result, ExifTool 8.38 (just released) disables writing of XMP to these older Illustrator EPS files.

Thanks for reporting this problem.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).