1 /* GIMP - The GNU Image Manipulation Program
2  * Copyright (C) 1995 Spencer Kimball and Peter Mattis
3  *
4  * file-darktable.c -- raw file format plug-in that uses darktable
5  * Copyright (C) 2016 Tobias Ellinghaus <me@houz.org>
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
19  */
20 
21 /* These are the raw formats that file-darktable will register */
22 
23 typedef struct _FileFormat FileFormat;
24 
25 struct _FileFormat
26 {
27   const gchar *file_type;
28   const gchar *mime_type;
29   const gchar *extensions;
30   const gchar *magic;
31 
32   const gchar *load_proc_format;
33   const gchar *load_blurb_format;
34   const gchar *load_help_format;
35 };
36 
37 /* some magic numbers taken from
38  * http://www.garykessler.net/library/file_sigs.html
39  *
40  * see also
41  * http://fileformats.archiveteam.org/wiki/Cameras_and_Digital_Image_Sensors
42  */
43 static const FileFormat file_formats[] =
44 {
45   {
46     N_("Raw Canon"),
47     "image/x-canon-cr2,image/x-canon-crw,image/x-canon-cr3",
48     "cr2,crw,cr3",
49     "0,string,II*\\0\\020\\0\\0\\0CR,"   /* cr2  */
50     "0,string,II\\024\\0\\0\\0HEAPCCDR," /* crw  */
51     "4,string,ftypcrx ",                 /* cr3  */
52 
53     "file-%s-canon-load",
54     "Load files in the Canon raw formats via %s",
55     "This plug-in loads files in Canon's raw formats by calling %s."
56   },
57 
58   {
59     N_("Raw Nikon"),
60     "image/x-nikon-nef,image/x-nikon-nrw",
61     "nef,nrw",
62     NULL,
63 
64     "file-%s-nikon-load",
65     "Load files in the Nikon raw formats via %s",
66     "This plug-in loads files in Nikon's raw formats by calling %s."
67   },
68 
69   {
70     N_("Raw Hasselblad"),
71     "image/x-hasselblad-3fr,image/x-hasselblad-fff",
72     "3fr,fff",
73     NULL,
74 
75     "file-%s-hasselblad-load",
76     "Load files in the Hasselblad raw formats via %s",
77     "This plug-in loads files in Hasselblad's raw formats by calling %s."
78   },
79 
80   {
81     N_("Raw Sony"),
82     "image/x-sony-arw,image/x-sony-srf,image/x-sony-sr2",
83     "arw,srf,sr2",
84     NULL,
85 
86     "file-%s-sony-load",
87     "Load files in the Sony raw formats via %s",
88     "This plug-in loads files in Sony's raw formats by calling %s."
89   },
90 
91   {
92     N_("Raw Casio BAY"),
93     "image/x-casio-bay",
94     "bay",
95     NULL,
96 
97     "file-%s-bay-load",
98     "Load files in the BAY raw format via %s",
99     "This plug-in loads files in Casio's raw BAY format by calling %s."
100   },
101 
102   {
103     N_("Raw Phantom Software CINE"),
104     "", /* FIXME: find a mime type */
105     "cine,cin",
106     NULL,
107 
108     "file-%s-cine-load",
109     "Load files in the CINE raw format via %s",
110     "This plug-in loads files in Phantom Software's raw CINE format by calling %s."
111   },
112 
113   {
114     N_("Raw Sinar"),
115     "", /* FIXME: find a mime type */
116     "cs1,ia,sti",
117     NULL,
118 
119     "file-%s-sinar-load",
120     "Load files in the Sinar raw formats via %s",
121     "This plug-in loads files in Sinar's raw formats by calling %s."
122   },
123 
124   {
125     N_("Raw Kodak"),
126     "image/x-kodak-dc2,image/x-kodak-dcr,image/x-kodak-kdc,image/x-kodak-k25,image/x-kodak-kc2",
127     "dc2,dcr,kdc,k25,kc2",
128     NULL,
129 
130     "file-%s-kodak-load",
131     "Load files in the Kodak raw formats via %s",
132     "This plug-in loads files in Kodak's raw formats by calling %s."
133   },
134 
135   {
136     N_("Raw Adobe DNG Digital Negative"),
137     "image/x-adobe-dng",
138     "dng",
139     NULL,
140 
141     "file-%s-dng-load",
142     "Load files in the DNG raw format via %s",
143     "This plug-in loads files in the Adobe Digital Negative DNG format by calling %s."
144   },
145 
146   {
147     N_("Raw Epson ERF"),
148     "image/x-epson-erf",
149     "erf",
150     NULL,
151 
152     "file-%s-erf-load",
153     "Load files in the ERF raw format via %s",
154     "This plug-in loads files in Epson's raw ERF format by calling %s."
155   },
156 
157   {
158     N_("Raw Phase One"),
159     "image/x-phaseone-cap,image/x-phaseone-iiq",
160     "cap,iiq",
161     NULL,
162 
163     "file-%s-phaseone-load",
164     "Load files in the Phase One raw formats via %s",
165     "This plug-in loads files in Phase One's raw formats by calling %s."
166   },
167 
168   {
169     N_("Raw Minolta"),
170     "image/x-minolta-mdc,image/x-minolta-mrw",
171     "mdc,mrw",
172     NULL,
173 
174     "file-%s-minolta-load",
175     "Load files in the Minolta raw formats via %s",
176     "This plug-in loads files in Minolta's raw formats by calling %s."
177   },
178 
179   {
180     N_("Raw Mamiya MEF"),
181     "image/x-mamiya-mef",
182     "mef", NULL,
183 
184     "file-%s-mef-load",
185     "Load files in the MEF raw format via %s",
186     "This plug-in loads files in Mamiya's raw MEF format by calling %s."
187   },
188 
189   {
190     N_("Raw Leaf MOS"),
191     "image/x-leaf-mos",
192     "mos",
193     NULL,
194 
195     "file-%s-mos-load",
196     "Load files in the MOS raw format via %s",
197     "This plug-in loads files in Leaf's raw MOS format by calling %s."
198   },
199 
200   {
201     N_("Raw Olympus ORF"),
202     "image/x-olympus-orf",
203     "orf",
204     "0,string,IIRO,0,string,MMOR,0,string,IIRS",
205 
206     "file-%s-orf-load",
207     "Load files in the ORF raw format via %s",
208     "This plug-in loads files in Olympus' raw ORF format by calling %s."
209   },
210 
211   {
212     N_("Raw Pentax PEF"),
213     "image/x-pentax-pef,image/x-pentax-raw",
214     "pef,raw",
215     NULL,
216 
217     "file-%s-pef-load",
218     "Load files in the PEF raw format via %s",
219     "This plug-in loads files in Pentax' raw PEF format by calling %s."
220   },
221 
222   {
223     N_("Raw Logitech PXN"),
224     "image/x-pxn", /* FIXME: is that the correct mime type? */
225     "pxn",
226     NULL,
227 
228     "file-%s-pxn-load",
229     "Load files in the PXN raw format via %s",
230     "This plug-in loads files in Logitech's raw PXN format by calling %s."
231   },
232 
233   {
234     N_("Raw Apple QuickTake QTK"),
235     "", /* FIXME: find a mime type */
236     "qtk",
237     NULL,
238 
239     "file-%s-qtk-load",
240     "Load files in the QTK raw format via %s",
241     "This plug-in loads files in Apple's QuickTake QTK raw format by calling %s."
242   },
243 
244   {
245     N_("Raw Fujifilm RAF"),
246     "image/x-fuji-raf",
247     "raf",
248     "0,string,FUJIFILMCCD-RAW",
249 
250     "file-%s-raf-load",
251     "Load files in the RAF raw format via %s",
252     "This plug-in loads files in Fujifilm's raw RAF format by calling %s."
253   },
254 
255   {
256     N_("Raw Panasonic"),
257     "image/x-panasonic-raw,image/x-panasonic-rw2",
258     "raw,rw2",
259     "0,string,IIU\\0",
260 
261     "file-%s-panasonic-load",
262     "Load files in the Panasonic raw formats via %s",
263     "This plug-in loads files in Panasonic's raw formats by calling %s."
264   },
265 
266   {
267     N_("Raw Digital Foto Maker RDC"),
268     "", /* FIXME: find a mime type */
269     "rdc",
270     NULL,
271 
272     "file-%s-rdc-load",
273     "Load files in the RDC raw format via %s",
274     "This plug-in loads files in Digital Foto Maker's raw RDC format by calling %s."
275   },
276 
277   {
278     N_("Raw Leica RWL"),
279     "image/x-leica-rwl",
280     "rwl",
281     NULL,
282 
283     "file-%s-rwl-load",
284     "Load files in the RWL raw format via %s",
285     "This plug-in loads files in Leica's raw RWL format by calling %s."
286   },
287 
288   {
289     N_("Raw Samsung SRW"),
290     "image/x-samsung-srw",
291     "srw",
292     NULL,
293 
294     "file-%s-srw-load",
295     "Load files in the SRW raw format via %s",
296     "This plug-in loads files in Samsung's raw SRW format by calling %s."
297   },
298 
299   {
300     N_("Raw Sigma X3F"),
301     "image/x-sigma-x3f",
302     "x3f",
303     "0,string,FOVb",
304 
305     "file-%s-x3f-load",
306     "Load files in the X3F raw format via %s",
307     "This plug-in loads files in Sigma's raw X3F format by calling %s."
308   },
309 
310   {
311     N_("Raw Arriflex ARI"),
312     "",
313     "ari",
314     NULL,
315 
316     "file-%s-ari-load",
317     "Load files in the ARI raw format via %s",
318     "This plug-in loads files in Arriflex' raw ARI format by calling %s."
319   }
320 };
321