Serialized Format


Contents

This document describes the format of the serialized (flattened) descriptor data encountered in some Photoshop data files: brushes (.abr), gradients (.grd), styles (.asl), etc., matching the format expected by the ActionDescriptor.fromStream method (in JavaScript), or by the corresponding HandleToDescriptor routine of the ActionDescriptor suite (in C/C++), i.e. prefixed by a 32-bit integer equal to 16.

Note: unless indicated otherwise, all multi-byte values, i.e., integer numbers (including C-style 4-character constants), floating-point (double) numbers, and Unicode characters are coded in big-endian format.

Serialized format

Descriptor data

Length (in bytes) Description Comments
4 Descriptor version (= 16) 32-bit integer
variable Descriptor object Object format.

Primitives format

Boolean

Length (in bytes) Description Comments
1 Boolean value 8-bit integer.

Byte string

Length (in bytes) Description Comments
4 Number of characters 32-bit integer.
Variable String of characters One byte per character.

Class

Length (in bytes) Description Comments
Variable Class name (usually empty) Unicode string format.
Variable Class ID ID format.

Double

Length (in bytes) Description Comments
8 Double 64-bit double.

Enumerated

Length (in bytes) Description Comments
Variable Enumerated type ID ID format.
Variable Enumerated value ID ID format.

File alias

Length (in bytes) Description Comments
4 Length (in bytes) of the alias structure 32-bit integer.
Variable Alias structure Opaque data used on Mac OS.

File path

Length (in bytes) Description Comments
4 Length (in bytes) of the path structure 32-bit integer.
4 Unicode text signature (= 'utxt') C-style 4-character constant, in little-endian format.
4 Length (in bytes) of the path structure 32-bit integer, in little-endian format.
4 Number of Unicode characters 32-bit integer, in little-endian format.
Variable String of Unicode characters Two bytes per character, in little-endian format; includes terminating null.

ID

Length (in bytes) Description Comments
4 Length 32-bit integer; CharID if 0, StringID otherwise.
4 or variable CharID or StringID C-style 4-character constant if CharID; string of characters if StringID.

Identifier

Length (in bytes) Description Comments
4 Identifier value 32-bit integer (unsigned).

Index

Length (in bytes) Description Comments
4 Index value 32-bit integer (unsigned).

Integer

Length (in bytes) Description Comments
4 Integer number 32-bit integer (signed).

Item

Length (in bytes) Description Comments
4 Type C-style 4-character constant:
  • 'bool' (Boolean)
  • 'type' or 'GlbC' (Class)
  • 'doub' (Double)
  • 'enum' (Enumerated)
  • 'alis' (File alias)
  • 'Pth ' (File path)
  • 'long' (Integer)
  • 'comp' (Large integer)
  • 'VlLs' (List)
  • 'Objc' or 'GlbO' (Object)
  • 'tdta' (Raw data)
  • 'obj ' (Reference)
  • 'TEXT' (Unicode string)
  • 'UntF' (Unit double)
or:
  • 'ObAr' (Object array)
Variable Value Depending on type: or:

Key-item pair

Length (in bytes) Description Comments
Variable Key ID ID format.
Variable Item Item format.

Large integer

Length (in bytes) Description Comments
8 Large integer number 64-bit integer (signed).

List

Length (in bytes) Description Comments
4 Number of items in the list 32-bit integer.
Variable Sequence of items Each in Item format.

Name

Length (in bytes) Description Comments
Variable Name string Unicode string format.

Object

Length (in bytes) Description Comments
Variable Class Class format.
4 Number of key-item pairs in the object 32-bit integer.
Variable Sequence of key-item pairs Each in Key-item pair format.

Offset

Length (in bytes) Description Comments
4 Offset value 32-bit integer (signed).

Property

Length (in bytes) Description Comments
Variable Key ID ID format.

Raw data

Length (in bytes) Description Comments
4 Length (in bytes) of the raw data value 32-bit integer.
Variable Raw data value Sequence of bytes.

Reference

Length (in bytes) Description Comments
4 Number of items in the reference 32-bit integer.
Variable Sequence of reference items Each in Reference item format.

Reference item

Length (in bytes) Description Comments
4 Form C-style 4-character constant:
  • 'Clss' (Class)
  • 'Enmr' (Enumerated)
  • 'Idnt' (Identifier)
  • 'indx' (Index)
  • 'name' (Name)
  • 'rele' (Offset)
  • 'prop' (Property)
Variable Desired class Class format.
Variable (0 for Class) Value Depending on form:

Unicode string

Length (in bytes) Description Comments
4 Number of Unicode characters 32-bit integer.
Variable String of Unicode characters Two bytes per character; includes terminating null.

Unit double

Length (in bytes) Description Comments
4 Unit ID C-style 4-character constant:
  • '#Ang' (Angle)
  • '#Rsl' (Density)
  • '#Rlt' (Distance)
  • '#Nne' (None)
  • '#Prc' (Percent)
  • '#Pxl' (Pixels)
or, for text code only:
  • '#Mlm' (Millimeters)
  • '#Pnt' (Points)
8 Double 64-bit double.

Object array format

Object array

Length (in bytes) Description Comments
4 Number of objects in the array 32-bit integer.
Variable Object class Class format.
4 Number of key-item pairs in each object 32-bit integer.
Variable Sequence of key-item pairs Each in Object array key-item pair format.

Object array key-item pair

Length (in bytes) Description Comments
Variable Key ID ID format.
4 Item type C-style 4-character constant:
  • 'UnFl' (Unit doubles)
Variable Item value Depending on item type:

Unit doubles

Length (in bytes) Description Comments
4 Unit ID C-style 4-character constant:
  • '#Rlt' (Distance)
  • '#Prc' (Percent)
  • '#Pxl' (Pixels)
4 Number of doubles 32-bit integer; should be the same as the number of objects in the array.
Variable Sequence of doubles Each as 64-bit double.


Doc version: 1.0
Date: 2024-10-10
Copyright: © 2024 Michel MARIANI
Disclaimer: this information is provided 'as is' without warranty of any kind, express or implied; use it at your own risk.