Determine if eps is vector or raster

Hi there,

I’ve stumbled upon a problem here, and hope one of you genius can help me.

My script handles a dropped folder and opens all images in photoshop, changes colorprofile and resolution and finaly saves it as a tiff.
No problems, so far.
Detection is based on extension.
But what if the extension is .eps?
Is this a vector or a rasterfile?
Rasterfiles should be handled by Photoshop, vectorfiles should be left alone.
How do I determine that.

Any suggestions?

Thanks in advance

Well, technically, an EPS is always a vector file. But it can have embedded bitmap data. This problem you’re having is the number 1 reason why I have abandoned (and not the only one) this outdated format. PSD and AI native files work as well, if not better. This extension dilemma has thus been solved.

But is not solving yours though. Maybe check who the creator is for a specific file? If there is a creator code. Perhaps the UTI info could be more useful.

I don’t see an easy way out of this, due to the fact that they can be either or… Perhaps Photoshop writes something special inside an EPS file that other vector apps don’t? Open two of them with TextEdit and look if there is any clue to this, like a creator tag in the postscript headers.

Good luck!

on a pixel image when I open it in Text Edit I see this kind of thing:

%!PS-Adobe-3.0 EPSF-3.0
%%Creator: Adobe Photoshop Version 9.0x196
%%Title: image12345.eps
%%CreationDate: 10/24/06 4:12 PM
%%BoundingBox: 0 0 228 340

and on a vector image:

%!PS-Adobe-3.0 EPSF-3.0
%%Creator: Adobe Illustrator(r) 6.0
%%For: (Chris)
%%Title: (Firebird.eps 25percent)
%%CreationDate: (9/13/98) (3:38 AM)
%%BoundingBox: -177 -122 813 867

So you’ll probably be able to read the first couple hundred bytes of an image and see if it contains “photoshop” or “illustrator”… but there could be other apps that create files too so you might not want to limit it to those only.

I would treat 8BIM ( photoshop creator code ) as image and all else as mixed.