xref: /freebsd/contrib/file/magic/Magdir/icc (revision 40427cca7a9ae77b095936fb1954417c290cfb17)
1b6cee71dSXin LI
2b6cee71dSXin LI#------------------------------------------------------------------------------
3*40427ccaSGordon Tetlow# $File: icc,v 1.5 2017/08/13 00:21:47 christos Exp $
4b6cee71dSXin LI# icc:  file(1) magic for International Color Consortium file formats
5b6cee71dSXin LI
6b6cee71dSXin LI#
7b6cee71dSXin LI# Color profiles as per the ICC's "Image technology colour management -
8b6cee71dSXin LI# Architecture, profile format, and data structure" specification.
9b6cee71dSXin LI# See
10b6cee71dSXin LI#
11b6cee71dSXin LI#	http://www.color.org/specification/ICC1v43_2010-12.pdf
12b6cee71dSXin LI#
13b6cee71dSXin LI# for Specification ICC.1:2010 (Profile version 4.3.0.0).
14*40427ccaSGordon Tetlow# URL: http://fileformats.archiveteam.org/wiki/ICC_profile
15*40427ccaSGordon Tetlow# Reference: http://www.color.org/iccmax/ICC.2-2016-7.pdf
16*40427ccaSGordon Tetlow# Update: Joerg Jenderek
17b6cee71dSXin LI#
18b6cee71dSXin LI# Bytes 36 to 39 contain a generic profile file signature of "acsp";
19b6cee71dSXin LI# bytes 40 to 43 "may be used to identify the primary platform/operating
20b6cee71dSXin LI# system framework for which the profile was created".
21b6cee71dSXin LI#
22*40427ccaSGordon Tetlow#	check and display ICC/ICM color profile
23*40427ccaSGordon Tetlow0	name	color-profile
24*40427ccaSGordon Tetlow>36	string		acsp
25*40427ccaSGordon Tetlow# skip ASCII like Cognacspirit.txt by month <= 12
26*40427ccaSGordon Tetlow>>26	ubeshort	<13
27*40427ccaSGordon Tetlow# platform/operating system. Only 5 mentioned
28b6cee71dSXin LI
29*40427ccaSGordon Tetlow#
30b6cee71dSXin LI# This appears to be what's used for Apple ColorSync profiles.
31b6cee71dSXin LI# Instead of adding that, Apple just changed the generic "acsp" entry
32b6cee71dSXin LI# to be for "ColorSync ICC Color Profile" rather than "Kodak Color
33b6cee71dSXin LI# Management System, ICC Profile".
34b6cee71dSXin LI# Yes, it's "APPL", not "AAPL"; see the spec.
35*40427ccaSGordon Tetlow>>>40	string		APPL		ColorSync
36b6cee71dSXin LI
37b6cee71dSXin LI# Microsoft ICM color profile
38*40427ccaSGordon Tetlow>>>40	string		MSFT		Microsoft
39b6cee71dSXin LI
40b6cee71dSXin LI# Yes, that's a blank after "SGI".
41*40427ccaSGordon Tetlow>>>40	string		SGI\ 		SGI
42b6cee71dSXin LI
43b6cee71dSXin LI# XXX - is this what's used for the Sun KCMS or not?  The standard file
44b6cee71dSXin LI# uses just "acsp" for that, but Apple's file uses it for "ColorSync",
45b6cee71dSXin LI# and there *is* an identified "primary platform" value of SUNW.
46*40427ccaSGordon Tetlow>>>40	string		SUNW		Sun KCMS
47*40427ccaSGordon Tetlow
48*40427ccaSGordon Tetlow# 5th platform
49*40427ccaSGordon Tetlow>>>40	string		TGNT		Taligent
50*40427ccaSGordon Tetlow
51*40427ccaSGordon Tetlow# remaining "l" "e" of "color profile" printed later to avoid error
52*40427ccaSGordon Tetlow>>>40	string		x 		color profi
53*40427ccaSGordon Tetlow#>>>40	string		x		(%.4s)
54b6cee71dSXin LI!:mime	application/vnd.iccprofile
55*40427ccaSGordon Tetlow# for "ICM" extension only versions 2.x and for Kodak "CC" 2.0 is found
56*40427ccaSGordon Tetlow>>>8	ubyte		=2
57*40427ccaSGordon Tetlow# do not use empty message text to a avoid error like
58*40427ccaSGordon Tetlow# icc, 82: Warning: Current entry does not yet have a description for adding a EXTENSION type
59*40427ccaSGordon Tetlow# file.exe: could not find any valid magic files!
60*40427ccaSGordon Tetlow>>>>9	ubyte		!0		\ble
61*40427ccaSGordon Tetlow!:ext	icc/icm
62*40427ccaSGordon Tetlow# minor version
63*40427ccaSGordon Tetlow>>>>9	ubyte		=0		\bl
64*40427ccaSGordon Tetlow# Kodak colour management system
65*40427ccaSGordon Tetlow>>>>>4	string		=KCMS		\be
66*40427ccaSGordon Tetlow!:ext	icc/icm/cc
67*40427ccaSGordon Tetlow>>>>>4	string		!KCMS		\be
68*40427ccaSGordon Tetlow!:ext	icc/icm
69*40427ccaSGordon Tetlow>>>8	ubyte		!2		\ble
70*40427ccaSGordon Tetlow!:ext	icc
71*40427ccaSGordon Tetlow# Profile version major.4bit-minor.sub1.sub2 like 4.3.0.0 (04300000h)
72*40427ccaSGordon Tetlow>>>8	ubyte		x		%u
73*40427ccaSGordon Tetlow>>>9	ubyte/16	x		\b.%u
74*40427ccaSGordon Tetlow# reserved and shall be null but 205.205 in umx1220u.icm
75*40427ccaSGordon Tetlow>>>10	ubyte		>0		\b.%u
76*40427ccaSGordon Tetlow>>>>11	ubyte		>0		\b.%u
77*40427ccaSGordon Tetlow# preferred colour management module like appl CCMS KCMS Lino UCCM "Win " "FF  "
78*40427ccaSGordon Tetlow# skip space like in brmsl08f.icm and null like in brmsl09f.icm, brmsl07f.icm
79*40427ccaSGordon Tetlow>>>4	string		>\ 		\b, type %.2s
80*40427ccaSGordon Tetlow>>>>6	string		>\  		\b%.1s
81*40427ccaSGordon Tetlow>>>>>7	string		>\  		\b%.1s
82*40427ccaSGordon Tetlow# colour space "XYZ " "Lab " "RGB " CMYK GRAY ...
83*40427ccaSGordon Tetlow>>>16	string		x		\b, %.3s
84*40427ccaSGordon Tetlow>>>19	string		>\  		\b%.1s
85*40427ccaSGordon Tetlow# Profile Connection Space (PCS) field usually "XYZ " or "Lab " but sometimes
86*40427ccaSGordon Tetlow# null or CMYK like in ISOcoated_v2_to_PSOcoated_v3_DeviceLink.icc
87*40427ccaSGordon Tetlow>>>20	string		>\0		\b/%.3s
88*40427ccaSGordon Tetlow>>>>23	string		>\ 		\b%.1s
89*40427ccaSGordon Tetlow# eleven device classes
90*40427ccaSGordon Tetlow>>>12	string		x		\b-%.4s device
91*40427ccaSGordon Tetlow# skip 00001964h in hpf69000.icc or 0h in XRDC50Q.ICM or " ROT" in brmsl05f.icm
92*40427ccaSGordon Tetlow>>>52	string		>\040
93*40427ccaSGordon Tetlow# skip "none" model like in "Trinitron Compatible 9300K G2.2.icm"
94*40427ccaSGordon Tetlow>>>>52	ubelong		!0x6e6f6e65
95*40427ccaSGordon Tetlow# device manufacturer field like "HP  " "IBM " EPSO
96*40427ccaSGordon Tetlow>>>>>48	string		x		\b, %.2s
97*40427ccaSGordon Tetlow>>>>>50	string		>\  		\b%.1s
98*40427ccaSGordon Tetlow>>>>>51	string		>\  		\b%.1s
99*40427ccaSGordon Tetlow# model like "ADI " "A265" and skip 20000404h in IS330.icm for RICOH RUSSIAN-SC
100*40427ccaSGordon Tetlow>>>>>52	string		>\ \  		\b/%.3s
101*40427ccaSGordon Tetlow>>>>>>55 string		>\  		\b%.1s
102*40427ccaSGordon Tetlow>>>>>52	string		x		model
103*40427ccaSGordon Tetlow# creator (often same as manufacture) like HP SONY XROX or null like in A925A.icm
104*40427ccaSGordon Tetlow>>>80	string		>\0		by %.2s
105*40427ccaSGordon Tetlow>>>>82	string		>\  		\b%.1s
106*40427ccaSGordon Tetlow>>>>>83	string		>\  		\b%.1s
107*40427ccaSGordon Tetlow# profile size
108*40427ccaSGordon Tetlow>>>0	ubelong		x		\b, %u bytes
109*40427ccaSGordon Tetlow# skip invalid date 0 like in linearSRGB.icc
110*40427ccaSGordon Tetlow>>>24	ubequad		!0
111*40427ccaSGordon Tetlow# datetime dd-mm-yyyy hh:mm:ss
112*40427ccaSGordon Tetlow>>>>28	ubeshort	x		\b, %u
113*40427ccaSGordon Tetlow# month <= 12
114*40427ccaSGordon Tetlow>>>>26	ubeshort	x		\b-%u
115*40427ccaSGordon Tetlow# year
116*40427ccaSGordon Tetlow>>>>24	ubeshort	x		\b-%u
117*40427ccaSGordon Tetlow# do not display midnight time like in CNHP8308.ICC
118*40427ccaSGordon Tetlow>>>>30	ubequad&0xFFffFFffFFff0000	!0
119*40427ccaSGordon Tetlow# hour <= 24
120*40427ccaSGordon Tetlow>>>>>30	ubeshort	x		%u
121*40427ccaSGordon Tetlow# minutes <= 59
122*40427ccaSGordon Tetlow>>>>>32	ubeshort	x		\b:%.2u
123*40427ccaSGordon Tetlow# seconds <= 59
124*40427ccaSGordon Tetlow>>>>>34	ubeshort	x		\b:%.2u
125*40427ccaSGordon Tetlow# vendor specific flags like 2 in HPCLJ5.ICM
126*40427ccaSGordon Tetlow>>>44	ubeshort	>0		\b, 0x%x vendor flags
127*40427ccaSGordon Tetlow# profile flags bits 0-2 of least 16 used by ICC
128*40427ccaSGordon Tetlow#>>>44	ubelong		>0		\b, 0x%x flags
129*40427ccaSGordon Tetlow# icEmbeddedProfileTrue
130*40427ccaSGordon Tetlow>>>44	ubelong		&1		\b, embedded
131*40427ccaSGordon Tetlow# icEmbeddedProfileFalse
132*40427ccaSGordon Tetlow#>>>44	ubelong		^1		\b, not embedded
133*40427ccaSGordon Tetlow# icUseWithEmbeddedDataOnly
134*40427ccaSGordon Tetlow>>>44	ubelong		&2		\b, dependently
135*40427ccaSGordon Tetlow# icUseAnywhere
136*40427ccaSGordon Tetlow#>>>44	ubelong		^2		\b, independently
137*40427ccaSGordon Tetlow>>>44	ubelong		&4		\b, MCS
138*40427ccaSGordon Tetlow#>>>44	ubelong		^4		\b, no MCS
139*40427ccaSGordon Tetlow# vendor specific device attributes 1~srgb.icc
140*40427ccaSGordon Tetlow# E000D00h~CNB7QEDA.ICM C000A00h~CNB5FCAA.ICM 01040401h~CNB25PE3.ICM
141*40427ccaSGordon Tetlow>>>56	ubelong		>0		\b, 0x%x vendor attribute
142*40427ccaSGordon Tetlow# ICC device attributes bits 0-7 used
143*40427ccaSGordon Tetlow#>>>60	ubelong		x		\b, 0x%x attribute
144*40427ccaSGordon Tetlow# http://www.color.org/icc34.h
145*40427ccaSGordon Tetlow>>>60	ubelong		&0x01		\b, transparent
146*40427ccaSGordon Tetlow#>>>60	ubelong		^0x01		\b, reflective
147*40427ccaSGordon Tetlow>>>60	ubelong		&0x02		\b, matte
148*40427ccaSGordon Tetlow#>>>60	ubelong		^0x02		\b, glossy
149*40427ccaSGordon Tetlow>>>60	ubelong		&0x04		\b, negative
150*40427ccaSGordon Tetlow#>>>60	ubelong		^0x04		\b, positive
151*40427ccaSGordon Tetlow>>>60	ubelong		&0x08		\b, black&white
152*40427ccaSGordon Tetlow#>>>60	ubelong		^0x08		\b, colour
153*40427ccaSGordon Tetlow>>>60	ubelong		&0x10		\b, non-paper
154*40427ccaSGordon Tetlow#>>>60	ubelong		^0x10		\b, paper
155*40427ccaSGordon Tetlow>>>60	ubelong		&0x20		\b, non-textured
156*40427ccaSGordon Tetlow#>>>60	ubelong		^0x20		\b, textured
157*40427ccaSGordon Tetlow>>>60	ubelong		&0x40		\b, non-isotropic
158*40427ccaSGordon Tetlow#>>>60	ubelong		^0x40		\b, isotropic
159*40427ccaSGordon Tetlow>>>60	ubelong		&0x80		\b, self-luminous
160*40427ccaSGordon Tetlow#>>>60	ubelong		^0x80		\b, non-self-luminous
161*40427ccaSGordon Tetlow# rendering intent 0-3 but 7AEA5027h in EE051__1.ICM 6CB1BCh in EE061__1.ICM
162*40427ccaSGordon Tetlow>>>64	ubelong		>3		\b, 0x%x rendering intent
163*40427ccaSGordon Tetlow#>>>64	ubelong		=0		\b, perceptual
164*40427ccaSGordon Tetlow>>>64	ubelong		=1		\b, relative colorimetric
165*40427ccaSGordon Tetlow>>>64	ubelong		=2		\b, saturation
166*40427ccaSGordon Tetlow>>>64	ubelong		=3		\b, absolute colorimetric
167*40427ccaSGordon Tetlow# PCS illuminant (3*s15Fixed16Numbers) often 0000f6d6 00010000 0000d32d
168*40427ccaSGordon Tetlow>>>71	ubequad		!0xd6000100000000d3	\b, PCS
169*40427ccaSGordon Tetlow# usually X~0.9642*65536=63189.8112~63190=F6D5h ; but also found
170*40427ccaSGordon Tetlow# often F6D6 in gt5000r.icm, F6B8 in kodakce.icm, F6CA in RSWOP.icm
171*40427ccaSGordon Tetlow>>>>68	ubelong			!0x0000f6d5	X=0x%x
172*40427ccaSGordon Tetlow# usually Y=1.0~00010000h but Y=0 in brmsl07f.icm
173*40427ccaSGordon Tetlow>>>>72	ubelong			!0x00010000	Y=0x%x
174*40427ccaSGordon Tetlow# usually Z~0.8249*65536=54060.6464~54061=D32Dh ; but also found
175*40427ccaSGordon Tetlow# D2F7 in hp1200c.icm, often D32C in A925A.icm, D309 in RSWOP.icm , D2F8 in kodak_dc.icm
176*40427ccaSGordon Tetlow>>>>76	ubelong			!0x0000d32d	Z=0x%x
177*40427ccaSGordon Tetlow# Profile ID. MD5 fingerprinting method as defined in Internet RFC 1321.
178*40427ccaSGordon Tetlow>>>84	ubequad		>0		\b, 0x%llx MD5
179*40427ccaSGordon Tetlow# reserved in older versions should be zero but also found CDCDCDCDCDCDCDCD
180*40427ccaSGordon Tetlow#>>100	ubequad		x		\b 0x%llx reserved
181*40427ccaSGordon Tetlow# tag table
182*40427ccaSGordon Tetlow# 6 <= tags count <= 43
183*40427ccaSGordon Tetlow#>>>128	ubelong		>43		\b, %u tags
184*40427ccaSGordon Tetlow>>>128	ubelong		x
185*40427ccaSGordon Tetlow# shall contain the profileDescriptionTag "desc" , copyrightTag "cprt"
186*40427ccaSGordon Tetlow# search range = tags count * 12 -8=< maximal tag count * 12 -8= 43 * 12 -8= 508
187*40427ccaSGordon Tetlow>>>>132	search/508	cprt
188*40427ccaSGordon Tetlow# but no copyright tag in linearSRGB.icc
189*40427ccaSGordon Tetlow# beneath /System/Library/Frameworks/WebKit.framework/
190*40427ccaSGordon Tetlow# Versions/A/Frameworks/WebCore.framework/Versions/A/Resources
191*40427ccaSGordon Tetlow>>>>132	default		x		\b, no copyright tag
192*40427ccaSGordon Tetlow# 1st tag
193*40427ccaSGordon Tetlow#>>>132	string		x		\b, 1st tag %.4s
194*40427ccaSGordon Tetlow#>>>136	ubelong		x		0x%x offset
195*40427ccaSGordon Tetlow#>>>140	ubelong		x		0x%x len
196*40427ccaSGordon Tetlow# 2nd tag,...
197*40427ccaSGordon Tetlow# look also for profileDescriptionTag "desc"
198*40427ccaSGordon Tetlow>>>132	search/508	desc
199*40427ccaSGordon Tetlow# look further for TextDescriptionType "desc" signature
200*40427ccaSGordon Tetlow>>>>(&0.L)	string		=desc
201*40427ccaSGordon Tetlow>>>>>&4		pstring/l	x	"%s"
202*40427ccaSGordon Tetlow# look alternative for multiLocalizedUnicodeType "mluc" signature like in VideoPAL.icc
203*40427ccaSGordon Tetlow>>>>(&0.L)	string		=mluc
204*40427ccaSGordon Tetlow>>>>>&(&8.L)	ubequad		x
205*40427ccaSGordon Tetlow>>>>>>&4	bestring16	x	'%s'
206b6cee71dSXin LI
207b6cee71dSXin LI# Any other profile.
208b6cee71dSXin LI# XXX - should we use "acsp\0\0\0\0" for "no primary platform" profiles,
209b6cee71dSXin LI# and use "acsp" for everything else and dump the "primary platform"
210b6cee71dSXin LI# string in those cases?
211*40427ccaSGordon Tetlow36	string		acsp
212*40427ccaSGordon Tetlow>0	use		color-profile
213b6cee71dSXin LI
214b6cee71dSXin LI
215