In addition to documents that the user creates in Adobe Photoshop (discussed in In addition to documents that the user creates in Adobe Photoshop (discussed in Chapter
Chapter1, “The Photos1, “The Photoshop File Fhop File Formatormat””), there are a number of additional files used), there are a number of additional files used by Photoshop to store information about such items as colors, brushes, and so forth. by Photoshop to store information about such items as colors, brushes, and so forth. These are known as
These are known as load files.load files.
This chapter describes the format of
This chapter describes the format of each load file. Some of the files can saved by theeach load file. Some of the files can saved by the
user; others
user; others are load onlyare load only, as indicated in the , as indicated in the sections.sections.
Each file has a unique file type and file extension associated with it. Photoshop for Each file has a unique file type and file extension associated with it. Photoshop for Macintosh recognizes either, but does not require the use
Macintosh recognizes either, but does not require the use of the extension. In the of the extension. In the filefile
dialogs, Photoshop for Windows looks for files with the given file extension dialogs, Photoshop for Windows looks for files with the given file extension automatically; this can be overridden.
automatically; this can be overridden. Under Mac OS, all information is stored in
Under Mac OS, all information is stored in the data forks of Photothe data forks of Photoshop’s load files.shop’s load files.
The files are completely interchangable with
The files are completely interchangable with Windows or any other platform.Windows or any other platform.
N
NOOTTEE:: Consistent byte ordering is required across platforms when reading and Consistent byte ordering is required across platforms when reading and writingwriting
load files. Photoshop stores multi–byte values with the high–order
load files. Photoshop stores multi–byte values with the high–order bytes first,bytes first,
(big–endian), as on Mac OS., which is the opposite of Windows’ standard byte (big–endian), as on Mac OS., which is the opposite of Windows’ standard byte order.. For more information, see “Macintosh
order.. For more information, see “Macintosh and Windows development” inand Windows development” in
chapter 2 of
chapter 2 of
Photoshop API Guide.pdfPhotoshop API Guide.pdf
..N
NOOTTEE:: All values defined as Unicode strings consist of:All values defined as Unicode strings consist of:
–
– A 4-byA 4-byte length fite length field, repreld, representiesenting the numbng the number of charer of characters iacters in the string (n the string (notnot
bytes). bytes). –
Actions Actions
3
3
Actions
Actions
Actions are accessed by means of the
Actions are accessed by means of the Actions palette. The object effects use theActions palette. The object effects use the
actions mechanism to output information to the PSD file format. actions mechanism to output information to the PSD file format.
Each action file comprises an
Each action file comprises an action set action set . The format of the action file is described in. The format of the action file is described in
the table below: the table below:
T
T ABLE ABLE 33..11 AAccttiioon n ffiille e ttyyppees s
O
OSS FFiilleettyyppee//eexxtteennssiioonn
Mac OS
Mac OS 8BAC8BAC
Windows
Windows .ATN.ATN
T
T ABLE ABLE 33..22 AAccttiioon fn fiille fe foorrmmaat t
L
Leennggtthh DDeessccrriippttiioonn
4
4 VVeerrssiioon n ( ( = = 1166))
V
Variaariablblee UniUnicodcode se strintring: g: actaction ion set set namnamee
1
1 BBoooolleeaann: : ttrruue e iif f sseet t iis s eexxppaannddeed d ffoor r tthhe e AAccttiioonns s ppaalleettttee
4
4 NNuummbbeer r oof f aaccttiioonns s iin n aaccttiioon n sseett
The following is repeated for each action in th
The following is repeated for each action in the sete set
2
2 IInnddeex x oof f aaccttiioonn
1
1 BBoooolleeaann: : ttrruue e iif f SShhiifft t kkeey y nneeeeddeed d ffoor r kkeeyybbooaarrd d sshhoortrtccuutt
1
1 BBoooolleeaann: : ttrruue e iif f CCoommmmaannd d kkeey y nneeeeddeed fd foor r kkeeyybbooaarrd d sshhoortrtccuutt
2
2 CCoolloor r iinnddeex x iinnffoorrmmaattiioonn
V
Variariabablele UniUnicocode stde striringng: act: actioion namn namee
1
1 BBoooolleeaann: : ttrruue e iif f aaccttiioon n iis s eexxppaannddeed id in tn thhe Ae Accttiioonns s ppaalleettttee
4
4 NNuummbbeer r oof f iitteemms s iin n aaccttiioonn
The following is repeated for each item The following is repeated for each item 1
1 BBoooolleeaann: : ttrruue e iif f aaccttiioon n iis s eexxppaannddeed id in tn thhe Ae Accttiioonns s ppaalleettttee
1
1 BBoooolleeaann: : ttrruue e iif f aaccttiioon n iis s eennaabblleedd
1
1 BBoooolleeaann: : ttrruue e iif f ddiiaallooggs s sshhoouulld d bbe e ddiissppllaayyeedd
1
Actions Actions
33
4
4 IIddeennttiiffiieerr::'TEXT''TEXT'oror'long''long'
V
Variariabablele EvEventent: if i: if idedentintififier ier iss 'TEXT''TEXT',4 bytes of length followed by the string;,4 bytes of length followed by the string;
if identifier is
if identifier is 'long''long', 4 bytes of itemID, 4 bytes of itemID
V
Variablariablee DictiDictionary namonary name: 4 e: 4 bytes bytes of leof length fngth followollowed by ed by the sthe stringtring
4
4 --1 1 iif f a a ddeessccrriippttoor r ffoolllloowws s oor r 0 0 ffoor r nnoonnee..
V
Variaariablblee DescDescriptriptor: seor: see Dese Descripcriptor tor strustructucture (re (TTablablee3.33.3) for details) for details
T
T ABLE ABLE 33..33 DDeesscrcriippttoor r ssttrruuccttuurre e
L
Leennggtthh DDeessccrriippttiioonn
V
Variaariablblee UniUnicode code stristring: ng: namname fe from rom claclassIssIDD
V
Variablariablee classclassID: 4 byID: 4 bytes (ltes (length), ength), follfollowed eowed either bither by string y string or (if or (if length ilength is zers zero) 4-o) 4-
byte classID byte classID 4
4 NNuummbbeer r oof f iitteemms s iin n ddeessccrriippttoorr
The following is repeated for each item in descriptor The following is repeated for each item in descriptor V
Variablariablee KeKey: 4 bytey: 4 bytes ( length) fs ( length) folloollowed eithwed either by ster by string or (if lring or (if length is zength is zero) 4-bero) 4-byteyte
key key 4 4 TTyyppee: : OOSSTTyyppe e kkeeyy 'obj ' = Reference 'obj ' = Reference 'Objc' = Descriptor 'Objc' = Descriptor 'VlLs' = List 'VlLs' = List 'doub' = Double 'doub' = Double 'UntF' = Unit float 'UntF' = Unit float 'TEXT' = String 'TEXT' = String 'enum'= Enumerated 'enum'= Enumerated 'long' = Integer 'long' = Integer 'bool' = Boolean 'bool' = Boolean
'GlbO' = GlobalObject same as Descriptor 'GlbO' = GlobalObject same as Descriptor 'type' or GlbC'= Class
'type' or GlbC'= Class 'alis' = Alias
'alis' = Alias
V
Variaariablblee Item tItem type: sype: see the taee the tablbles beles below foow for each pr each possossibible typle typee
T
T ABLE ABLE 33..22 AAccttiioon fn fiille fe foorrmmaat t
L
Actions Actions
3
3
T
T ABLE ABLE 33..44 RReeffeerreenncce Se Sttrruuccttuurre e
L
Leennggtthh DDeessccrriippttiioonn
4
4 NNuummbbeer r oof f iitteemmss
The following is repeated for each item in reference The following is repeated for each item in reference 4
4 OOSSTTyyppe e kkeey y ffoor r ttyyppe e tto o uussee::
'prop' = Property 'prop' = Property 'Clss' = Class 'Clss' = Class 'Enm
'Enmr' = Enumerated Referencer' = Enumerated Reference 'rele' = Offset 'rele' = Offset 'Idnt' = Identifier 'Idnt' = Identifier 'indx' = Index 'indx' = Index 'name' =Name 'name' =Name V
Variaariablblee Item tItem type: sype: see the taee the tablbles beles below fow for eacor each possh possibible Refle Refereerence tynce typepe
T
T ABLE ABLE 33..55 PPrrooppeerrtty y SSttrruuccttuurre e
L
Leennggtthh DDeessccrriippttiioonn
V
Variable ariable Unicode Unicode string: string: name name from from classIDclassID
V
Variaariablblee claclassIssID: 4 byD: 4 bytes (tes (lenlength)gth), fol, followlowed eited either bher by stry string or ing or (if l(if lengtength is zh is zeroero) 4-) 4-
byte classID byte classID V
Variaariablblee KeKeyIDyID: 4 byt: 4 bytes (les (lengength)th), fol, followlowed eited either bher by striy string or (ing or (if lenf length igth is zers zero) 4-o) 4-
byte keyID byte keyID
T
T ABLE ABLE 33..66 UUnniit t ffllooaat st sttrruuccttuurre e
L
Leennggtthh DDeessccrriippttiioonn
4
4 UUnniitts s tthhe e ffoolllloowwiinng g vvaalluue e iis s iinn. . OOnne e oof f tthhe e ffoolllloowwiinngg::
'#Ang'
'#Ang'= angle: base degrees= angle: base degrees
'#Rsl'
'#Rsl'= density: base per inch= density: base per inch
'#Rlt'
'#Rlt'= distance: base 72ppi= distance: base 72ppi
'#Nne'
'#Nne'= none: coerced.= none: coerced.
'#Prc'
'#Prc' = percent:= percent: ged unit value ged unit value
'#Pxl'
'#Pxl'= pixels: tagged unit value= pixels: tagged unit value 8
Actions Actions
33
TT ABLE ABLE 33..77 DDoouubblle e ssttrruuccttuurre e
L
Leennggtthh DDeessccrriippttiioonn
8
8 AAccttuuaal l vvaalluue e ((ddoouubbllee))
T
T ABLE ABLE 33..88 CCllaasss ss sttrruuccttuurre e
L
Leennggtthh DDeessccrriippttiioonn
V
Variaariablblee UniUnicode code stristring: ng: namname fre from com claslassIDsID
V
Variablariablee ClassIClassID: 4 byteD: 4 bytes (lengts (length), foh), followllowed either bed either by string or (y string or (if lengtif length is zeroh is zero) 4-) 4-
byte classID byte classID
T
T ABLE ABLE 33..99 SSttrriinng g ssttrruuccttuurre e
L
Leennggtthh DDeessccrriippttiioonn
V
Varariaiablblee StStriring vng valalue aue as Uns Unicicodode ste striringng
T
T ABLE ABLE 33.1.100 EnEnumumereratated ed rerefefererencnce e
L
Leennggtthh DDeessccrriippttiioonn
V
Varariaiablblee UnUnicicodode ste striringng: na: name fme frorom Clm ClasassIsIDD..
V
Variaariablblee ClaClassIssID: 4 bD: 4 byteytes (les (lengthngth), f), follollowowed eied either ther by sby strintring or (g or (if leif length ngth is zis zeroero))
4-byte classID 4-byte classID V
Variaariablblee TTypeypeID: 4 bID: 4 byteytes (les (lengthngth), f), follollowowed eited either bher by striy string or (ing or (if lenf length is zgth is zeroero) 4-) 4-
byte typeID byte typeID V
Variaariablblee enumenum: 4 by: 4 bytes (tes (lenlength)gth), fo, follollowed ewed eithither ber by stry string oing or (ir (if lenf length igth is zes zero) 4ro) 4--
byte enum byte enum
T
T ABLE ABLE 33.1.111 OOffffseset t sstrtruuctctuurre e
L
Leennggtthh DDeessccrriippttiioonn
V
Varariaiablblee UnUnicicodode ste striringng: na: name fme frorom Cm ClalassssIDID
V
Variaariablblee ClaClassIssID: 4 byD: 4 bytes (tes (lenlength)gth), fo, follollowed ewed eithither by ser by strintring or (ig or (if lenf length is gth is zerzero) 4-o) 4-
byte classID byte classID 4
4 VVaalluue e oof f tthhe e ooffffsseett
T
Actions Actions
3
3
T
T ABLE ABLE 33..1133 AAlliiaas sts strruuccttuurre e
L
Leennggtthh DDeessccrriippttiioonn
4
4 LLeennggtth h oof f ddaatta a tto o ffoollllooww
Variable
Variable FSSpecFSSpecfor Macintosh or a handle to a string to the full path on Windowsfor Macintosh or a handle to a string to the full path on Windows
T
T ABLE ABLE 33..1144 LLiisst st sttrruuccttuurre e
L
Leennggtthh DDeessccrriippttiioonn
4
4 NNuummbbeer r oof f iitteemms s iin n tthhe e lliisstt
The following is repeated for each item in list The following is repeated for each item in list 4
4 OOSSTTyyppe e kkeey y ffoor r ttyyppe e tto o uussee. . SSeeee TTablablee3.33.3for types.for types.
V
Variaariablblee See See the the tabtables les aboabove ve fofor ear each pch possossibible tle typeype
T
T ABLE ABLE 33..1155 IInntteeggeer r
L
Leennggtthh DDeessccrriippttiioonn
4
4 VVaalluuee
T
T ABLE ABLE 33.1.166 EnEnumumereratated ed dedescscririptptor or
L
Leennggtthh DDeessccrriippttiioonn
V
Variablariablee TType: 4 byteype: 4 bytes (lengths (length), foll), followed eitowed either by striher by string or (if lengtng or (if length is zero) 4-h is zero) 4-bytebyte
typeID typeID V
Variablariablee Enum: 4 Enum: 4 bytes bytes (lengt(length), fh), followollowed eitheed either by sr by string or tring or (if len(if length is zgth is zero) 4-ero) 4-
byte enum byte enum