Copy link to clipboard
Copied
The format of Photoshop EPS files is partially documented here:
http://www.adobe.com/devnet-apps/photoshop/fileformatashtml/#50577413_pgfId-1035096
Photoshop includes a comment in the EPS files it writes so that it is able to read them back in again. Third party programs that write pixel-based EPS files may want to include this comment in their EPS files, so Photoshop can read their files.
The comment must follow immediately after the %% comment block at the start of the file. The comment is:
%Image
...Copy link to clipboard
Copied
Usually, the only way to get information like this is to scan the file. There may be something in the exif data so you might want to check there first.
Copy link to clipboard
Copied
Hi xbytor,
Thanks for your reply. Does not given any information in metadata exif.
Since the metadata means data about data information which is derived from image.
Is possible to get or not?
-yajiv
Copy link to clipboard
Copied
If the info you need is not in the exif metadata you will need to scan the image file. I don't have the EPS file format spec at my fingertips so I can't tell you how to find the encoding part of the spec. Take a trip on google and see if you can find it.
Copy link to clipboard
Copied
Hi xbytor,
Once again thanks for your reply. I tried lot on google but I can't find..
Please help me the Binary value of Save encoding for BINARY or ASCII or ASCII85.
Since I get binary value for Clipping path , Normal path and work path available in document. Hence save encoding has binary value. If possible can you find that binary value..?
Ex:
Path = '8BIM\x07\xd0'
Clipping Path = '8BIM\x0b\xb7'
WorkPath = '8BIM\x04\x01'
Copy link to clipboard
Copied
I created an empty document and saved it three times with the different encodings. The only difference I saw in the headers was at offset 8 in the files. These are the 4 bytes at 0x8 into the file for the different encodings:
Binary - 02 d2 d2 0
ASCII85 - 07 9e 06 01
ASCII - fd 18 9f 01
I couldn't find the right spec for the EPS file format so I'm not sure if these bytes will always be the correct ones but it's a start.
Copy link to clipboard
Copied
The format of Photoshop EPS files is partially documented here:
http://www.adobe.com/devnet-apps/photoshop/fileformatashtml/#50577413_pgfId-1035096
Photoshop includes a comment in the EPS files it writes so that it is able to read them back in again. Third party programs that write pixel-based EPS files may want to include this comment in their EPS files, so Photoshop can read their files.
The comment must follow immediately after the %% comment block at the start of the file. The comment is:
%ImageData: <columns> <rows> <depth> <mode> <pad channels> <block size> <binary/hex> "<data start>"
<columns>: Width of the image in pixels.
<rows>: Height of the image in pixels.
<depth>: Number of bits per channel. Must be 1 or 8.
<mode>: Image mode. Bitmap/grayscale = 1; Lab = 2; RGB = 3; CMYK = 4.
<pad channels>: Number of other channels store in the file. Ignored when reading. Photoshop uses this to include a grayscale image that is printed on non-color PostScript printers.
<block size>:Number of bytes per row per channel. Will be either 1 or formula (below):
1 = Data is interleaved.
(columns*depth+7)/8 = Data is stored in line-interleaved format, or there is only one channel.
<binary/hex>:
1 = Data is in binary format.
2 = Data is in hex ascii format.
<data start>: Entire PostScript line immediately preceding the image data. This entire line should not occur elsewhere in the PostScript header code, but it may occur at part of a line.
Besides, some information about other values of <binary/hex> can be found here:
http://python.6.x6.nabble.com/Correctly-determine-image-size-of-a-Photoshop-EPS-td2096786.html
1 - binary
2 - ascii
3 - jpeg low quality
4 - jpeg medium quality
5 - jpeg high quality
6 - jpeg maximum quality
7 - ascii85
Here is a test script using this information:
function main ()
{
function isPhotoshopEPSFile (f)
{
return (f.type === 'EPSF') || f.name.match (/\.eps$/i);
}
var epsFilter =
(File.fs === "Macintosh") ?
function (f) { return (f instanceof Folder) || isPhotoshopEPSFile (f) } :
"Photoshop EPS Files:*.eps,All Files:*.*";
var epsFile = File.openDialog ("Open Photoshop EPS file:", epsFilter);
if (epsFile)
{
if (epsFile.open ("r"))
{
while (!epsFile.eof)
{
var line = epsFile.readln ();
var found = line.match (/^%ImageData:\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)/);
if (found)
{
var dataFormatIndex = found[7];
var dataFormats =
[
"Binary",
"ASCII",
"JPEG (low quality)",
"JPEG (medium quality)",
"JPEG (high quality)",
"JPEG (maximum quality)",
"ASCII85"
];
alert (dataFormats[dataFormatIndex - 1]);
break;
}
}
epsFile.close ();
}
}
}
main ();
HTH,
--Mikaeru
Copy link to clipboard
Copied
Thanks xbytor and Mikaeru,
Its Awesome.....:) and that was what i needed.
Once again Thanks for your support.
-yajiv
Copy link to clipboard
Copied
Once again, Mikaeru69, you have shown me how far behind the curve I am. I do appreciate your contributions to the community.
Copy link to clipboard
Copied
いえいえ、とんでもないです Not at all, really...
All of us Photoshop scripters know what we owe you, you've shown us so many times and for so long how to do things that seemed absolutely impossible to achieve... Many many thanks to you!