Issue 1661: Kodak DCR support

This commit is contained in:
torger
2013-11-03 10:43:53 +01:00
parent c452ff20b8
commit 1e2eb4e1c6
11 changed files with 239 additions and 30 deletions

View File

@@ -1,5 +1,5 @@
--- dcraw.c 2013-08-12 09:32:14.000000000 +0200
+++ dcraw.cc 2013-10-22 08:42:39.000000000 +0200
+++ dcraw.cc 2013-11-03 10:34:08.000000000 +0100
@@ -1,3 +1,15 @@
+/*RT*/#include <glib.h>
+/*RT*/#include <glib/gstdio.h>
@@ -671,7 +671,16 @@
float romm_cam[3][3];
fseek (ifp, offset, SEEK_SET);
@@ -5284,8 +4913,8 @@
@@ -5265,6 +4894,8 @@
wbi = -2;
}
if (tag == 2118) wbtemp = getint(type);
+ if (tag == 2120 + wbi) /* RT: wb tag for DCS760 */
+ FORC3 cam_mul[c] = 2048.0 / getreal(type); /* RT: wb tag for DCS760 */
if (tag == 2130 + wbi)
FORC3 mul[c] = getreal(type);
if (tag == 2140 + wbi && wbi >= 0)
@@ -5284,8 +4915,8 @@
}
}
@@ -682,7 +691,7 @@
int CLASS parse_tiff_ifd (int base)
{
@@ -5299,7 +4928,7 @@
@@ -5299,7 +4930,7 @@
unsigned sony_curve[] = { 0,0,0,0,0,4095 };
unsigned *buf, sony_offset=0, sony_length=0, sony_key=0;
struct jhead jh;
@@ -691,7 +700,7 @@
if (tiff_nifds >= sizeof tiff_ifd / sizeof tiff_ifd[0])
return 1;
@@ -5737,12 +5366,13 @@
@@ -5737,12 +5368,13 @@
fread (buf, sony_length, 1, ifp);
sony_decrypt (buf, sony_length/4, 1, sony_key);
sfp = ifp;
@@ -711,7 +720,7 @@
ifp = sfp;
free (buf);
}
@@ -5766,6 +5396,7 @@
@@ -5766,6 +5398,7 @@
int CLASS parse_tiff (int base)
{
int doff;
@@ -719,7 +728,7 @@
fseek (ifp, base, SEEK_SET);
order = get2();
@@ -5843,7 +5474,7 @@
@@ -5843,7 +5476,7 @@
case 8: load_raw = &CLASS eight_bit_load_raw; break;
case 12: if (tiff_ifd[raw].phint == 2)
load_flags = 6;
@@ -728,7 +737,7 @@
case 14: load_flags = 0;
case 16: load_raw = &CLASS unpacked_load_raw;
if (!strncmp(make,"OLYMPUS",7) &&
@@ -5959,7 +5590,7 @@
@@ -5959,7 +5592,7 @@
{
const char *file, *ext;
char *jname, *jfile, *jext;
@@ -737,7 +746,7 @@
ext = strrchr (ifname, '.');
file = strrchr (ifname, '/');
@@ -5981,13 +5612,14 @@
@@ -5981,13 +5614,14 @@
} else
while (isdigit(*--jext)) {
if (*jext != '9') {
@@ -754,7 +763,7 @@
if (verbose)
fprintf (stderr,_("Reading metadata from %s ...\n"), jname);
parse_tiff (12);
@@ -6330,7 +5962,11 @@
@@ -6330,7 +5964,11 @@
order = get2();
hlen = get4();
if (get4() == 0x48454150) /* "HEAP" */
@@ -766,7 +775,7 @@
if (parse_tiff (save+6)) apply_tiff();
fseek (ifp, save+len, SEEK_SET);
}
@@ -6582,7 +6218,8 @@
@@ -6582,7 +6220,8 @@
{
static const struct {
const char *prefix;
@@ -776,7 +785,7 @@
} table[] = {
{ "AgfaPhoto DC-833m", 0, 0, /* DJC */
{ 11438,-3762,-1115,-2409,9914,2497,-1227,2295,5300 } },
@@ -7383,6 +7020,27 @@
@@ -7383,6 +7022,27 @@
}
break;
}
@@ -804,7 +813,7 @@
}
void CLASS simple_coeff (int index)
@@ -7682,13 +7340,20 @@
@@ -7682,13 +7342,20 @@
fread (head, 1, 32, ifp);
fseek (ifp, 0, SEEK_END);
flen = fsize = ftell(ifp);
@@ -827,7 +836,7 @@
parse_ciff (hlen, flen-hlen, 0);
load_raw = &CLASS canon_load_raw;
} else if (parse_tiff(0)) apply_tiff();
@@ -7734,6 +7399,7 @@
@@ -7734,6 +7401,7 @@
fseek (ifp, 100+28*(shot_select > 0), SEEK_SET);
parse_tiff (data_offset = get4());
parse_tiff (thumb_offset+12);
@@ -835,7 +844,7 @@
apply_tiff();
} else if (!memcmp (head,"RIFF",4)) {
fseek (ifp, 0, SEEK_SET);
@@ -7839,15 +7505,18 @@
@@ -7839,15 +7507,18 @@
if (make[0] == 0) parse_smal (0, flen);
if (make[0] == 0) {
parse_jpeg(0);
@@ -863,7 +872,7 @@
}
for (i=0; i < sizeof corp / sizeof *corp; i++)
@@ -7878,7 +7547,7 @@
@@ -7878,7 +7549,7 @@
if (height == 3136 && width == 4864) /* Pentax K20D and Samsung GX20 */
{ height = 3124; width = 4688; filters = 0x16161616; }
if (width == 4352 && (!strcmp(model,"K-r") || !strcmp(model,"K-x")))
@@ -872,7 +881,7 @@
if (width >= 4960 && !strncmp(model,"K-5",3))
{ left_margin = 10; width = 4950; filters = 0x16161616; }
if (width == 4736 && !strcmp(model,"K-7"))
@@ -8026,7 +7695,7 @@
@@ -8026,7 +7697,7 @@
width -= 44;
} else if (!strcmp(model,"D3200") ||
!strcmp(model,"D600") ||
@@ -881,7 +890,7 @@
width -= 46;
} else if (!strcmp(model,"D4")) {
width -= 52;
@@ -8630,195 +8299,8 @@
@@ -8630,195 +8301,8 @@
cmsCloseProfile (hInProfile);
}
#endif
@@ -1079,7 +1088,7 @@
struct tiff_tag {
ushort tag, type;
@@ -8841,584 +8323,12 @@
@@ -8841,584 +8325,12 @@
unsigned gps[26];
char desc[512], make[64], model[64], soft[32], date[20], artist[64];
};