simplemagic icon indicating copy to clipboard operation
simplemagic copied to clipboard

Problem with detecting Illustrator file

Open markwoon opened this issue 7 years ago • 4 comments

This Illustrator file (Oxycodone_PK.zip) is not being detected as such.

I'm not quite sure how this file got into this state. I'm guessing that it started life as a PDF file, then got opened in Illustrator, and then saved as an Illustrator file. So this is kind of a corner case...

The property you're keying off of (dc:format) is there, and has the correct value. It just seems to have been moved around a bit.

markwoon avatar Mar 22 '18 22:03 markwoon

It looks like like simplemagic is sensitive to the exact location of the property. Moving the property to the top of the file seems to resolve this problem. See Oxycodone_PK-fixed.zip for an example.

Is there a way to make simplemagic less susceptible to these kinds of problems? Can it read the metadata directly?

markwoon avatar Jul 06 '18 01:07 markwoon

@j256 Any idea if this can be fixed?

markwoon avatar Oct 25 '18 16:10 markwoon

The problem with these is that this is a zip file. Being able to detect that it contains an Illustrator document requires different processing. I think it needs to be done but I'm not sure when I can get to it. Feel free to submit some code and I'll take a look at it.

j256 avatar Oct 25 '18 21:10 j256

@j256 I've attached zip files because I couldn't attach the .ai file directly. Please take a look at the Illustrator file in the zip file to test.

markwoon avatar Oct 26 '18 20:10 markwoon