Page 1 of 1

Illustrator .ai file not using embedded thumbnail with Use embedded thumbnail 'on'

Posted: Mon Feb 17, 2025 1:10 am
by tajinoxn
XnView MP browser does not use embedded thumbnail in Illustrator .ai file with "Use embedded thumbnail" option checked in Tools > Settings > Thumbnails > Use embedded thumbnail.

In Illustrator .ai file version from CS1 to CS6, CC to 2020, the embedded thumbnail image is stored in XMP Thumbnail Image binary tag in jpeg format. The tag is visible in XnView Info panel > ExifTool tab, and can extracted with

Code: Select all

exiftool -b -ThumbnailImage "file.ai" > "file.jpg"
Extracting the embedded jpeg thumbnail should be quick, without the need to use ghostscript to read the pdf copy in the .ai file especially if the .ai file is saved without pdf compatibility.

I have attached example .ai files for testing :
Illustrator example files - Current CS-2020.zip
(1.6 MiB) Downloaded 45 times
(thumbnail image in xmp tag)

It would be good enough for current use cases to just implement xmp thumbnail image extraction for .ai files version from CS1 to current 2020.

----

However if you would like to support legacy v7 - v10 formats, the embedded thumbnail image is in binary data
Illustrator example files - Legacy v8-v10.zip
(420.27 KiB) Downloaded 47 times
For Illustrator .ai file from version 7 to 10, the embedded thumbnail image is stored in binary chunk %AI7_Thumbnail: %%BeginData:, refer to this link on how to read the data https://groups.google.com/g/adobe.illus ... C1RBJ7nQoJ

just in case the link no longer exists, the info is pasted below :

Code: Select all

%AI7_Thumbnail: width height bitsperpixel
%%BeginData: hexdigitcount Hex Bytes
color table data
image data

Both the color table and image data are ASCII Hex encoded. Each line of data is preceded by a '%' character to make them comments as far as
PostScript is concerned.

The color table is present only if bitsperpixel is 8 (I think this is the usual case but the code does appear to also support 24 bit data). The color table consists of 256 RGB triples. Each triple consists of three bytes in the order R, G, B.

The image data may or may not be RLE compressed. It is RLE compressed if the first three bytes are 'R', 'L', 'E'. Otherwise it is not RLE compressed.

The following algorithm decompresses the RLE data:

let b = next input byte
if (b != 0xFD)
copy b to the output
else
let b = next input byte
if (b == 0xFD)
copy b to the output
else
let n = b
let b = next input byte
copy b to the output n times
endif
endif
Hope you can look into it, thanks!

Re: Illustrator .ai file not using embedded thumbnail with Use embedded thumbnail 'on'

Posted: Sun Jun 01, 2025 3:29 pm
by tajinoxn
Any chance this could be implemented? Displaying Illustrator .ai file thumbnail with embedded thumbnail image already available in the XMP tag.

Thanks.

Re: Illustrator .ai file not using embedded thumbnail with Use embedded thumbnail 'on'

Posted: Wed Jun 04, 2025 1:58 pm
by xnview
i'll check if its possible easily