1mime.types(5) OpenPrinting mime.types(5)
2
3
4
6 mime.types - mime type description file for cups
7
9 The mime.types file defines the recognized file types.
10
11 Additional file types are specified in files with the extension .types
12 in the CUPS configuration directory.
13
14 Each line in the mime.types file is a comment, blank, or rule line.
15 Comment lines start with the # character. Rule lines start with the
16 MIME media type and are optionally followed by a series of file recog‐
17 nition rules:
18
19 mime/type [ rule ... rule ]
20
21 Rules can be extended over multiple lines using the backslash character
22 (\):
23
24 mime/type [ really-really-really-long-rule ... \
25 rule ]
26
27 MIME media types specified by the mime/type field are case-insensitive
28 and are sorted in ascending alphanumeric order for the purposes of
29 matching. See the "TYPE MATCHING AND PRIORITY" section for more infor‐
30 mation.
31
32 The rules may be grouped using parenthesis, joined using "+" for a log‐
33 ical AND, joined using "," or whitespace for a logical OR, and negated
34 using "!".
35
36 RULES
37 Rules take two forms - a filename extension by itself and functions
38 with test values inside parenthesis. The following functions are
39 available:
40
41 match("pattern")
42 True if the filename matches the given shell wildcard pattern.
43
44 ascii(offset,length)
45 True if the length bytes starting at offset are valid printable
46 ASCII (CR, NL, TAB, BS, 32-126).
47
48 printable(offset,length)
49 True if the length bytes starting at offset are printable 8-bit
50 chars (CR, NL, TAB, BS, 32-126, 128-254).
51
52 priority(number)
53 Specifies the relative priority of this MIME media type. The de‐
54 fault priority is 100. Larger values have higher priority while
55 smaller values have lower priority.
56
57 string(offset,"string")
58 True if the bytes starting at offset are identical to string.
59
60 istring(offset,"string")
61 True if the bytes starting at offset match string without respect
62 to case.
63
64 char(offset,value)
65 True if the byte at offset is identical to value.
66
67 short(offset,value)
68 True if the 16-bit big-endian integer at offset is identical to
69 value.
70
71 int(offset,value)
72 True if the 32-bit big-endian integer at offset is identical to
73 value.
74
75 locale("string")
76 True if current locale matches string.
77
78 contains(offset,range,"string")
79 True if the bytes starting at offset for range bytes contains
80 string.
81
82 STRING CONSTANTS
83 String constants can be specified inside quotes ("") for strings con‐
84 taining whitespace and angle brackets (<>) for hexadecimal strings.
85
86 TYPE MATCHING AND PRIORITY
87 When CUPS needs to determine the MIME media type of a given file, it
88 checks every MIME media type defined in the .types files. When two or
89 more types match a given file, the type chosen will depend on the type
90 name and priority, with higher-priority types being used over lower-
91 priority ones. If the types have the same priority, the type names are
92 sorted alphanumerically in ascending order and the first type is cho‐
93 sen.
94
95 For example, if two types "text/bar" and "text/foo" are defined as
96 matching the extension "doc", normally the type "text/bar" will be cho‐
97 sen since its name is alphanumerically smaller than "text/foo". How‐
98 ever, if "text/foo" also defines a higher priority than "text/bar",
99 "text/foo" will be chosen instead.
100
102 /etc/cups - Typical CUPS configuration directory.
103
105 Define two MIME media types for raster data, with one being a subset
106 with higher priority:
107
108 application/vnd.cups-raster string(0,"RaSt") string(0,"tSaR") \
109 string(0,"RaS2") string(0,"2SaR") \
110 string(0,"RaS3") string(0,"3SaR")
111
112 image/pwg-raster string(0,"RaS2") + \
113 string(4,PwgRaster<00>) priority(150)
114
116 cups-files.conf(5), cupsd.conf(5), cupsd(8), cupsfilter(8),
117 mime.convs(5), CUPS Online Help (http://localhost:631/help)
118
120 Copyright © 2021-2022 by OpenPrinting.
121
122
123
1242021-02-28 CUPS mime.types(5)