Update to DCRAW 9.11

see issue 1036
This commit is contained in:
Oliver Duis 2011-10-09 18:47:58 +02:00
parent 9a226e547a
commit d619556df8
3 changed files with 196 additions and 89 deletions

View File

@ -1,6 +1,6 @@
/*
dcraw.c -- Dave Coffin's raw photo decoder
Copyright 1997-2010 by Dave Coffin, dcoffin a cybercom o net
Copyright 1997-2011 by Dave Coffin, dcoffin a cybercom o net
This is a command-line ANSI C program to convert raw photos from
any digital camera on any computer running any operating system.
@ -19,11 +19,11 @@
*If you have not modified dcraw.c in any way, a link to my
homepage qualifies as "full source code".
$Revision: 1.444 $
$Date: 2011/07/23 20:33:32 $
$Revision: 1.445 $
$Date: 2011/10/07 01:00:37 $
*/
#define DCRAW_VERSION "9.10"
#define DCRAW_VERSION "9.11"
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
@ -2494,7 +2494,7 @@ void CLASS sony_arw2_load_raw()
merror (data, "sony_arw2_load_raw()");
for (row=0; row < height; row++) {
fread (data, 1, raw_width, ifp);
for (dp=data, col=0; col < width-30; dp+=16) {
for (dp=data, col=0; col < raw_width-30; dp+=16) {
max = 0x7ff & (val = sget4(dp));
min = 0x7ff & val >> 11;
imax = 0x0f & val >> 22;
@ -2509,7 +2509,7 @@ void CLASS sony_arw2_load_raw()
bit += 7;
}
for (i=0; i < 16; i++, col+=2)
BAYER(row,col) = curve[pix[i] << 1] >> 2;
if (col < width) BAYER(row,col) = curve[pix[i] << 1] >> 2;
col -= col & 1 ? 1:31;
}
}
@ -4442,6 +4442,7 @@ void CLASS parse_makernote (int base, int uptag)
The MakerNote might have its own TIFF header (possibly with
its own byte-order!), or it might just be a table.
*/
if (!strcmp(make,"Nokia")) return;
fread (buf, 1, 10, ifp);
if (!strncmp (buf,"KDK" ,3) || /* these aren't TIFF tables */
!strncmp (buf,"VER" ,3) ||
@ -6367,6 +6368,8 @@ void CLASS adobe_coeff (const char *make, const char *model)
{ 13690,-5358,-1474,-3369,11600,1998,-132,1554,4395 } },
{ "FUJIFILM FinePix F550EXR", 0, 0,
{ 13690,-5358,-1474,-3369,11600,1998,-132,1554,4395 } },
{ "FUJIFILM FinePix F600EXR", 0, 0,
{ 13690,-5358,-1474,-3369,11600,1998,-132,1554,4395 } },
{ "FUJIFILM FinePix X100", 0, 0,
{ 12161,-4457,-1069,-5034,12874,2400,-795,1724,6904 } },
{ "Imacon Ixpress", 0, 0, /* DJC */
@ -6537,6 +6540,8 @@ void CLASS adobe_coeff (const char *make, const char *model)
{ 9698,-3367,-914,-4706,12584,2368,-837,968,5801 } },
{ "NIKON COOLPIX P7000", 0, 0,
{ 11432,-3679,-1111,-3169,11239,2202,-791,1380,4455 } },
{ "NIKON COOLPIX P7100", 0, 0,
{ 11053,-4269,-1024,-1976,10182,2088,-526,1263,4469 } },
{ "OLYMPUS C5050", 0, 0,
{ 10508,-3124,-1273,-6079,14294,1901,-1653,2306,6237 } },
{ "OLYMPUS C5060", 0, 0,
@ -6585,14 +6590,18 @@ void CLASS adobe_coeff (const char *make, const char *model)
{ 8343,-2050,-1021,-7715,15705,2103,-1831,2380,8235 } },
{ "OLYMPUS E-P2", 0, 0xffd,
{ 8343,-2050,-1021,-7715,15705,2103,-1831,2380,8235 } },
{ "OLYMPUS E-P3", 0, 0, /* DJC */
{ 7488,-3021,-55,-2377,8348,4029,-816,2405,6327 } },
{ "OLYMPUS E-P3", 0, 0,
{ 7575,-2159,-571,-3722,11341,2725,-1434,2819,6271 } },
{ "OLYMPUS E-PL1s", 0, 0,
{ 11409,-3872,-1393,-4572,12757,2003,-709,1810,7415 } },
{ "OLYMPUS E-PL1", 0, 0,
{ 11408,-4289,-1215,-4286,12385,2118,-387,1467,7787 } },
{ "OLYMPUS E-PL2", 0, 0,
{ 15030,-5552,-1806,-3987,12387,1767,-592,1670,7023 } },
{ "OLYMPUS E-PL3", 0, 0,
{ 7575,-2159,-571,-3722,11341,2725,-1434,2819,6271 } },
{ "OLYMPUS E-PM1", 0, 0,
{ 7575,-2159,-571,-3722,11341,2725,-1434,2819,6271 } },
{ "OLYMPUS SP350", 0, 0,
{ 12078,-4836,-1069,-6671,14306,2578,-786,939,7418 } },
{ "OLYMPUS SP3", 0, 0,
@ -6687,6 +6696,8 @@ void CLASS adobe_coeff (const char *make, const char *model)
{ 16197,-6146,-1761,-2393,10765,1869,366,2238,5248 } },
{ "LEICA V-LUX 2", 143, 0xfff,
{ 16197,-6146,-1761,-2393,10765,1869,366,2238,5248 } },
{ "Panasonic DMC-FZ150", 143, 0xfff,
{ 11904,-4541,-1189,-2355,10899,1662,-296,1586,4289 } },
{ "Panasonic DMC-FX150", 15, 0xfff,
{ 9082,-2907,-925,-6119,13377,3058,-1797,2641,5609 } },
{ "Panasonic DMC-G10", 0, 0,
@ -6695,28 +6706,32 @@ void CLASS adobe_coeff (const char *make, const char *model)
{ 8199,-2065,-1056,-8124,16156,2033,-2458,3022,7220 } },
{ "Panasonic DMC-G2", 15, 0xf3c,
{ 10113,-3400,-1114,-4765,12683,2317,-377,1437,6710 } },
{ "Panasonic DMC-G3", 143, 0xfff, /* DJC */
{ 6460,-2578,-366,-2786,8728,4059,-1073,2525,6254 } },
{ "Panasonic DMC-G3", 143, 0xfff,
{ 6763,-1919,-863,-3868,11515,2684,-1216,2387,5879 } },
{ "Panasonic DMC-GF1", 15, 0xf92,
{ 7888,-1902,-1011,-8106,16085,2099,-2353,2866,7330 } },
{ "Panasonic DMC-GF2", 143, 0xfff,
{ 7888,-1902,-1011,-8106,16085,2099,-2353,2866,7330 } },
{ "Panasonic DMC-GF3", 143, 0xfff, /* DJC */
{ 8407,-3261,-502,-3997,10651,3347,-1095,2742,7294 } },
{ "Panasonic DMC-GF3", 143, 0xfff,
{ 9051,-2468,-1204,-5212,13276,2121,-1197,2510,6890 } },
{ "Panasonic DMC-GH1", 15, 0xf92,
{ 6299,-1466,-532,-6535,13852,2969,-2331,3112,5984 } },
{ "Panasonic DMC-GH2", 15, 0xf95,
{ 7780,-2410,-806,-3913,11724,2484,-1018,2390,5298 } },
{ "Phase One H 20", 0, 0, /* DJC */
{ 1313,1855,-109,-6715,15908,808,-327,1840,6020 } },
{ "Phase One H 25", 0, 0,
{ 2905,732,-237,-8134,16626,1476,-3038,4253,7517 } },
{ "Phase One P 2", 0, 0,
{ 2905,732,-237,-8134,16626,1476,-3038,4253,7517 } },
{ "Phase One P 30", 0, 0,
{ 4516,-245,-37,-7020,14976,2173,-3206,4671,7087 } },
{ "Phase One P 45", 0, 0,
{ 5053,-24,-117,-5684,14076,1702,-2619,4492,5849 } },
{ "Phase One P40", 0, 0,
{ 8035,435,-962,-6001,13872,2320,-1159,3065,5434 } },
{ "Phase One P65", 0, 0,
{ 7914,1414,-1190,-8777,16582,2280,-2811,4605,5562 } },
{ 8035,435,-962,-6001,13872,2320,-1159,3065,5434 } },
{ "RED ONE", 704, 0xffff, /* DJC */
{ 21014,-7891,-2613,-3056,12201,856,-2203,5125,8042 } },
{ "SAMSUNG EX1", 0, 0x3e00,
@ -6765,20 +6780,28 @@ void CLASS adobe_coeff (const char *make, const char *model)
{ 5413,-1162,-365,-5665,13098,2866,-608,1179,8440 } },
{ "SONY DSLR-A900", 128, 0,
{ 5209,-1072,-397,-8845,16120,2919,-1618,1803,8654 } },
{ "SONY NEX-5N", 128, 0,
{ 5991,-1456,-455,-4764,12135,2980,-707,1425,6701 } },
{ "SONY NEX-C3", 128, 0,
{ 5991,-1456,-455,-4764,12135,2980,-707,1425,6701 } },
{ "SONY NEX-3", 138, 0, /* DJC */
{ 6907,-1256,-645,-4940,12621,2320,-1710,2581,6230 } },
{ "SONY NEX-5", 116, 0, /* DJC */
{ 6807,-1350,-342,-4216,11649,2567,-1089,2001,6420 } },
{ "SONY NEX-C3", 128, 0, /* DJC */
{ 5171,-1786,-46,-3375,9315,4061,-611,1865,6473 } },
{ "SONY NEX", 128, 0, /* Adobe's matrix */
{ "SONY NEX-3", 128, 0, /* Adobe */
{ 6549,-1550,-436,-4880,12435,2753,-854,1868,6976 } },
{ "SONY NEX-5", 128, 0, /* Adobe */
{ 6549,-1550,-436,-4880,12435,2753,-854,1868,6976 } },
{ "SONY SLT-A33", 128, 0,
{ 6069,-1221,-366,-5221,12779,2734,-1024,2066,6834 } },
{ "SONY SLT-A35", 128, 0, /* DJC */
{ 4504,-1495,115,-3507,9101,4407,-669,1844,6806 } },
{ "SONY SLT-A35", 128, 0,
{ 5986,-1618,-415,-4557,11820,3120,-681,1404,6971 } },
{ "SONY SLT-A55", 128, 0,
{ 5932,-1492,-411,-4813,12285,2856,-741,1524,6739 } }
{ 5932,-1492,-411,-4813,12285,2856,-741,1524,6739 } },
{ "SONY SLT-A65", 128, 0,
{ 5491,-1192,-363,-4951,12342,2948,-911,1722,7192 } },
{ "SONY SLT-A77", 128, 0,
{ 5491,-1192,-363,-4951,12342,2948,-911,1722,7192 } }
};
double cam_xyz[4][3];
char name[130];
@ -7171,13 +7194,13 @@ void CLASS identify()
{ height = 2616; width = 3896; }
if (height == 3136 && width == 4864) /* Pentax K20D and Samsung GX20 */
{ height = 3124; width = 4688; filters = 0x16161616; }
if (!strcmp(model,"K-r") || !strcmp(model,"K-x"))
if (width == 4352 && (!strcmp(model,"K-r") || !strcmp(model,"K-x")))
{ width = 4309; filters = 0x16161616; }
if (!strcmp(model,"K-5"))
if (width >= 4960 && !strcmp(model,"K-5"))
{ left_margin = 10; width = 4950; filters = 0x16161616; }
if (!strcmp(model,"K-7"))
if (width == 4736 && !strcmp(model,"K-7"))
{ height = 3122; width = 4684; filters = 0x16161616; top_margin = 2; }
if (!strcmp(model,"645D"))
if (width == 7424 && !strcmp(model,"645D"))
{ height = 5502; width = 7328; filters = 0x61616161; top_margin = 29;
left_margin = 48; }
if (height == 3014 && width == 4096) /* Ricoh GX200 */
@ -8065,6 +8088,8 @@ wb550:
adobe_coeff ("SONY","DSC-R1");
width = 3925;
order = 0x4d4d;
} else if (!strcmp(make,"SONY") && raw_width == 6048) {
width -= 24;
} else if (!strcmp(model,"DSLR-A100")) {
if (width == 3880) {
height--;

View File

@ -30,11 +30,11 @@
*If you have not modified dcraw.c in any way, a link to my
homepage qualifies as "full source code".
$Revision: 1.444 $
$Date: 2011/07/23 20:33:32 $
$Revision: 1.445 $
$Date: 2011/10/07 01:00:37 $
*/
#define DCRAW_VERSION "9.10"
#define DCRAW_VERSION "9.11"
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
@ -2504,7 +2504,7 @@ void CLASS sony_arw2_load_raw()
merror (data, "sony_arw2_load_raw()");
for (row=0; row < height; row++) {
fread (data, 1, raw_width, ifp);
for (dp=data, col=0; col < width-30; dp+=16) {
for (dp=data, col=0; col < raw_width-30; dp+=16) {
max = 0x7ff & (val = sget4(dp));
min = 0x7ff & val >> 11;
imax = 0x0f & val >> 22;
@ -2519,7 +2519,7 @@ void CLASS sony_arw2_load_raw()
bit += 7;
}
for (i=0; i < 16; i++, col+=2)
BAYER(row,col) = curve[pix[i] << 1] >> 2;
if (col < width) BAYER(row,col) = curve[pix[i] << 1] >> 2;
col -= col & 1 ? 1:31;
}
}
@ -4452,6 +4452,7 @@ void CLASS parse_makernote (int base, int uptag)
The MakerNote might have its own TIFF header (possibly with
its own byte-order!), or it might just be a table.
*/
if (!strcmp(make,"Nokia")) return;
fread (buf, 1, 10, ifp);
if (!strncmp (buf,"KDK" ,3) || /* these aren't TIFF tables */
!strncmp (buf,"VER" ,3) ||
@ -6388,6 +6389,8 @@ void CLASS adobe_coeff (const char *make, const char *model)
{ 13690,-5358,-1474,-3369,11600,1998,-132,1554,4395 } },
{ "FUJIFILM FinePix F550EXR", 0, 0,
{ 13690,-5358,-1474,-3369,11600,1998,-132,1554,4395 } },
{ "FUJIFILM FinePix F600EXR", 0, 0,
{ 13690,-5358,-1474,-3369,11600,1998,-132,1554,4395 } },
{ "FUJIFILM FinePix X100", 0, 0, /* RT - Colin Walker */
{ 10841,-3288,-807,-4652,12552,2344,-642,1355,7206 } },
{ "Imacon Ixpress", 0, 0, /* DJC */
@ -6558,6 +6561,8 @@ void CLASS adobe_coeff (const char *make, const char *model)
{ 9698,-3367,-914,-4706,12584,2368,-837,968,5801 } },
{ "NIKON COOLPIX P7000", 0, 0,
{ 11432,-3679,-1111,-3169,11239,2202,-791,1380,4455 } },
{ "NIKON COOLPIX P7100", 0, 0,
{ 11053,-4269,-1024,-1976,10182,2088,-526,1263,4469 } },
{ "OLYMPUS C5050", 0, 0,
{ 10508,-3124,-1273,-6079,14294,1901,-1653,2306,6237 } },
{ "OLYMPUS C5060", 0, 0,
@ -6616,6 +6621,8 @@ void CLASS adobe_coeff (const char *make, const char *model)
{ 11975,-3351,-1184,-4500,12639,2061,-1230,2353,7009 } },
{ "OLYMPUS E-PL3", 0, 0, /* RT - Colin Walker */
{ 7041,-1794,-336,-3790,11192,2984,-1364,2625,6217 } },
{ "OLYMPUS E-PM1", 0, 0,
{ 7575,-2159,-571,-3722,11341,2725,-1434,2819,6271 } },
{ "OLYMPUS SP350", 0, 0,
{ 12078,-4836,-1069,-6671,14306,2578,-786,939,7418 } },
{ "OLYMPUS SP3", 0, 0,
@ -6712,6 +6719,8 @@ void CLASS adobe_coeff (const char *make, const char *model)
{ 16197,-6146,-1761,-2393,10765,1869,366,2238,5248 } },
{ "LEICA V-LUX 2", 143, 0xfff,
{ 16197,-6146,-1761,-2393,10765,1869,366,2238,5248 } },
{ "Panasonic DMC-FZ150", 143, 0xfff,
{ 11904,-4541,-1189,-2355,10899,1662,-296,1586,4289 } },
{ "Panasonic DMC-FX150", 15, 0xfff,
{ 9082,-2907,-925,-6119,13377,3058,-1797,2641,5609 } },
{ "Panasonic DMC-G10", 15, 0xf3c, /* RT - Colin Walker */
@ -6734,14 +6743,18 @@ void CLASS adobe_coeff (const char *make, const char *model)
{ 6855,-1765,-456,-4223,11600,2996,-1450,2602,5761 } },
{ "Phase One H 20", 0, 0, /* DJC */
{ 1313,1855,-109,-6715,15908,808,-327,1840,6020 } },
{ "Phase One H 25", 0, 0,
{ 2905,732,-237,-8134,16626,1476,-3038,4253,7517 } },
{ "Phase One P 2", 0, 0,
{ 2905,732,-237,-8134,16626,1476,-3038,4253,7517 } },
{ "Phase One P 30", 0, 0,
{ 4516,-245,-37,-7020,14976,2173,-3206,4671,7087 } },
{ "Phase One P 45", 0, 0,
{ 5053,-24,-117,-5684,14076,1702,-2619,4492,5849 } },
{ "Phase One P40", 0, 0,
{ 8035,435,-962,-6001,13872,2320,-1159,3065,5434 } },
{ "Phase One P65", 0, 0,
{ 7914,1414,-1190,-8777,16582,2280,-2811,4605,5562 } },
{ 8035,435,-962,-6001,13872,2320,-1159,3065,5434 } },
{ "RED ONE", 704, 0xffff, /* DJC */
{ 21014,-7891,-2613,-3056,12201,856,-2203,5125,8042 } },
{ "SAMSUNG EX1", 0, 0x3e00,
@ -6800,11 +6813,13 @@ void CLASS adobe_coeff (const char *make, const char *model)
{ 5130,-1055,-269,-4473,11797,3050,-701,1310,7121 } },
{ "SONY SLT-A33", 128, 0,
{ 6069,-1221,-366,-5221,12779,2734,-1024,2066,6834 } },
{ "SONY SLT-A35", 128, 0, /* DJC */
{ 4504,-1495,115,-3507,9101,4407,-669,1844,6806 } },
{ "SONY SLT-A35", 128, 0,
{ 5986,-1618,-415,-4557,11820,3120,-681,1404,6971 } },
{ "SONY SLT-A55", 128, 0,
{ 5932,-1492,-411,-4813,12285,2856,-741,1524,6739 } },
{ "SONY SLT-A77V", 128, 0, /* RT - Colin Walker */
{ "SONY SLT-A65", 128, 0,
{ 5491,-1192,-363,-4951,12342,2948,-911,1722,7192 } },
{ "SONY SLT-A77", 128, 0, /* RT - Colin Walker */
{ 5126,-830,-261,-4788,12196,2934,-948,1602,7068 } }
};
double cam_xyz[4][3];
@ -7206,13 +7221,13 @@ void CLASS identify()
{ height = 2616; width = 3896; }
if (height == 3136 && width == 4864) /* Pentax K20D and Samsung GX20 */
{ height = 3124; width = 4688; filters = 0x16161616; }
if (!strcmp(model,"K-r") || !strcmp(model,"K-x"))
if (width == 4352 && (!strcmp(model,"K-r") || !strcmp(model,"K-x")))
/*RT*/ { width = 4308; filters = 0x16161616; }
if (!strcmp(model,"K-5"))
if (width >= 4960 && !strcmp(model,"K-5"))
{ left_margin = 10; width = 4950; filters = 0x16161616; }
if (!strcmp(model,"K-7"))
if (width == 4736 && !strcmp(model,"K-7"))
{ height = 3122; width = 4684; filters = 0x16161616; top_margin = 2; }
if (!strcmp(model,"645D"))
if (width == 7424 && !strcmp(model,"645D"))
{ height = 5502; width = 7328; filters = 0x61616161; top_margin = 29;
left_margin = 48; }
if (height == 3014 && width == 4096) /* Ricoh GX200 */
@ -8100,6 +8115,8 @@ wb550:
adobe_coeff ("SONY","DSC-R1");
width = 3925;
order = 0x4d4d;
} else if (!strcmp(make,"SONY") && raw_width == 6048) {
width -= 24;
} else if (!strcmp(model,"DSLR-A100")) {
if (width == 3880) {
height--;

View File

@ -1,6 +1,6 @@
--- C:/GCC/RT/RTSrc/rtengine/dcraw.c Tue Aug 16 06:59:22 2011
+++ C:/GCC/RT/RTSrc/rtengine/dcraw.cc Fri Sep 30 15:03:27 2011
@@ -1,3 +1,14 @@
--- C:/GCC/RT/RTSrc/rtengine/dcraw.c Sat Oct 08 18:05:56 2011
+++ C:/GCC/RT/RTSrc/rtengine/dcraw.cc Sat Oct 08 18:16:21 2011
@@ -1,6 +1,17 @@
+/*RT*/#include <glib.h>
+/*RT*/#include <glib/gstdio.h>
+/*RT*/#undef MAX
@ -14,7 +14,11 @@
+
/*
dcraw.c -- Dave Coffin's raw photo decoder
Copyright 1997-2010 by Dave Coffin, dcoffin a cybercom o net
- Copyright 1997-2011 by Dave Coffin, dcoffin a cybercom o net
+ Copyright 1997-2010 by Dave Coffin, dcoffin a cybercom o net
This is a command-line ANSI C program to convert raw photos from
any digital camera on any computer running any operating system.
@@ -98,18 +109,16 @@
#define LONG_BIT (8 * sizeof (long))
#endif
@ -139,6 +143,15 @@
void CLASS sinar_4shot_load_raw()
{
@@ -1731,7 +1741,7 @@
if ((r = row-top_margin - (shot >> 1 & 1)) >= height) continue;
for (col=0; col < raw_width; col++) {
if ((c = col-left_margin - (shot & 1)) >= width) continue;
- image[r*width+c][FC(row,col)] = pixel[col];
+ image[r*width+c][FC(row,col)] = pixel[col];
}
}
}
@@ -1843,10 +1853,10 @@
maximum = 0x3ff;
}
@ -167,6 +180,15 @@
cinfo->src->next_input_byte = jpeg_buffer;
cinfo->src->bytes_in_buffer = nbytes;
return TRUE;
@@ -2215,7 +2225,7 @@
for (col=0; col < raw_width; col++) {
val = curve[pixel[col]];
if ((unsigned) (col-left_margin) < width)
- BAYER(row,col-left_margin) = val;
+ BAYER(row,col-left_margin) = val;
else lblack += val;
}
}
@@ -2411,9 +2421,9 @@
maximum = (1 << (thumb_misc & 31)) - 1;
}
@ -188,6 +210,15 @@
struct decode *cur;
int i, len;
@@ -3651,7 +3661,7 @@
lpass = size*((lev & 1)+1);
for (row=0; row < iheight; row++) {
hat_transform (temp, fimg+hpass+row*iwidth, 1, iwidth, 1 << lev);
- for (col=0; col < iwidth; col++)
+ for (col=0; col < iwidth; col++)
fimg[lpass + row*iwidth + col] = temp[col] * 0.25;
}
for (col=0; col < iwidth; col++) {
@@ -4396,7 +4406,7 @@
}
}
@ -197,7 +228,7 @@
void CLASS parse_makernote (int base, int uptag)
{
@@ -4526,12 +4536,12 @@
@@ -4527,12 +4537,12 @@
cam_mul[0] = getreal(type);
cam_mul[2] = getreal(type);
}
@ -216,7 +247,7 @@
if (tag == 0x10 && type == 4)
unique_id = get4();
if (tag == 0x11 && is_raw && !strncmp(make,"NIKON",5)) {
@@ -4910,8 +4920,8 @@
@@ -4911,8 +4921,8 @@
}
}
@ -227,7 +258,7 @@
int CLASS parse_tiff_ifd (int base)
{
@@ -4925,7 +4935,7 @@
@@ -4926,7 +4936,7 @@
unsigned sony_curve[] = { 0,0,0,0,0,4095 };
unsigned *buf, sony_offset=0, sony_length=0, sony_key=0;
struct jhead jh;
@ -236,7 +267,7 @@
if (tiff_nifds >= sizeof tiff_ifd / sizeof tiff_ifd[0])
return 1;
@@ -4942,6 +4952,9 @@
@@ -4943,6 +4953,9 @@
case 6: height = get2(); break;
case 7: width += get2(); break;
case 9: filters = get2(); break;
@ -246,7 +277,7 @@
case 17: case 18:
if (type == 3 && len == 1)
cam_mul[(tag-17)*2] = get2() / 256.0;
@@ -5345,12 +5358,13 @@
@@ -5346,12 +5359,13 @@
fread (buf, sony_length, 1, ifp);
sony_decrypt (buf, sony_length/4, 1, sony_key);
sfp = ifp;
@ -265,7 +296,7 @@
ifp = sfp;
free (buf);
}
@@ -5375,6 +5389,8 @@
@@ -5376,6 +5390,8 @@
{
int doff;
@ -274,7 +305,7 @@
fseek (ifp, base, SEEK_SET);
order = get2();
if (order != 0x4949 && order != 0x4d4d) return 0;
@@ -5549,7 +5565,7 @@
@@ -5550,7 +5566,7 @@
{
const char *file, *ext;
char *jname, *jfile, *jext;
@ -283,7 +314,14 @@
ext = strrchr (ifname, '.');
file = strrchr (ifname, '/');
@@ -5577,7 +5593,8 @@
@@ -5572,13 +5588,14 @@
} else
while (isdigit(*--jext)) {
if (*jext != '9') {
- (*jext)++;
+ (*jext)++;
break;
}
*jext = '0';
}
if (strcmp (jname, ifname)) {
@ -293,7 +331,7 @@
if (verbose)
fprintf (stderr,_("Reading metadata from %s ...\n"), jname);
parse_tiff (12);
@@ -5916,7 +5933,11 @@
@@ -5917,7 +5934,11 @@
order = get2();
hlen = get4();
if (get4() == 0x48454150) /* "HEAP" */
@ -306,7 +344,7 @@
if (parse_tiff (save+6)) apply_tiff();
fseek (ifp, save+len, SEEK_SET);
}
@@ -6181,8 +6202,8 @@
@@ -6182,8 +6203,8 @@
{ 4716,603,-830,-7798,15474,2480,-1496,1937,6651 } },
{ "Canon EOS 5D", 0, 0xe6c,
{ 6347,-479,-972,-8297,15954,2480,-1968,2131,7649 } },
@ -317,7 +355,7 @@
{ "Canon EOS 10D", 0, 0xfa0,
{ 8197,-2000,-1118,-6714,14335,2592,-2536,3178,8266 } },
{ "Canon EOS 20Da", 0, 0,
@@ -6195,16 +6216,16 @@
@@ -6196,16 +6217,16 @@
{ 6071,-747,-856,-7653,15365,2441,-2025,2553,7315 } },
{ "Canon EOS 50D", 0, 0x3d93,
{ 4920,616,-593,-6493,13964,2784,-1774,3178,7005 } },
@ -338,9 +376,18 @@
{ "Canon EOS 500D", 0, 0x3479,
{ 4763,712,-646,-6821,14399,2640,-1921,3276,6561 } },
{ "Canon EOS 550D", 0, 0x3dd7,
@@ -6367,8 +6388,8 @@
@@ -6299,7 +6320,7 @@
{ "Canon PowerShot SX1 IS", 0, 0,
{ 6578,-259,-502,-5974,13030,3309,-308,1058,4970 } },
{ "Canon PowerShot SX110 IS", 0, 0, /* DJC */
- { 14134,-5576,-1527,-1991,10719,1273,-1158,1929,3581 } },
+ { 14134,-5576,-1527,-1991,10719,1273,-1158,1929,3581 } },
{ "CASIO EX-S20", 0, 0, /* DJC */
{ 11634,-3924,-1128,-4968,12954,2015,-1588,2648,7206 } },
{ "CASIO EX-Z750", 0, 0, /* DJC */
@@ -6370,8 +6391,8 @@
{ 13690,-5358,-1474,-3369,11600,1998,-132,1554,4395 } },
{ "FUJIFILM FinePix F550EXR", 0, 0,
{ "FUJIFILM FinePix F600EXR", 0, 0,
{ 13690,-5358,-1474,-3369,11600,1998,-132,1554,4395 } },
- { "FUJIFILM FinePix X100", 0, 0,
- { 12161,-4457,-1069,-5034,12874,2400,-795,1724,6904 } },
@ -349,7 +396,7 @@
{ "Imacon Ixpress", 0, 0, /* DJC */
{ 7025,-1415,-704,-5188,13765,1424,-1248,2742,6038 } },
{ "KODAK NC2000", 0, 0,
@@ -6499,8 +6520,8 @@
@@ -6502,8 +6523,8 @@
{ 8736,-2458,-935,-9075,16894,2251,-1354,1242,8263 } },
{ "NIKON D7000", 0, 0,
{ 8198,-2239,-724,-4871,12389,2798,-1043,2050,7181 } },
@ -360,7 +407,7 @@
{ "NIKON D70", 0, 0,
{ 7732,-2422,-789,-8238,15884,2498,-859,783,7330 } },
{ "NIKON D80", 0, 0,
@@ -6557,8 +6578,8 @@
@@ -6562,8 +6583,8 @@
{ 7828,-1761,-348,-5788,14071,1830,-2853,4518,6557 } },
{ "OLYMPUS E-330", 0, 0,
{ 8961,-2473,-1084,-7979,15990,2067,-2319,3035,8249 } },
@ -371,7 +418,7 @@
{ "OLYMPUS E-3", 0, 0xf99,
{ 9487,-2875,-1115,-7533,15606,2010,-1618,2100,7389 } },
{ "OLYMPUS E-400", 0, 0,
@@ -6575,24 +6596,26 @@
@@ -6580,26 +6601,26 @@
{ 8785,-2529,-1033,-7639,15624,2112,-1783,2300,7817 } },
{ "OLYMPUS E-520", 0, 0xfd2,
{ 8344,-2322,-1020,-7596,15635,2048,-1748,2269,7287 } },
@ -387,14 +434,16 @@
- { 8343,-2050,-1021,-7715,15705,2103,-1831,2380,8235 } },
- { "OLYMPUS E-P2", 0, 0xffd,
- { 8343,-2050,-1021,-7715,15705,2103,-1831,2380,8235 } },
- { "OLYMPUS E-P3", 0, 0, /* DJC */
- { 7488,-3021,-55,-2377,8348,4029,-816,2405,6327 } },
- { "OLYMPUS E-P3", 0, 0,
- { 7575,-2159,-571,-3722,11341,2725,-1434,2819,6271 } },
- { "OLYMPUS E-PL1s", 0, 0,
- { 11409,-3872,-1393,-4572,12757,2003,-709,1810,7415 } },
- { "OLYMPUS E-PL1", 0, 0,
- { 11408,-4289,-1215,-4286,12385,2118,-387,1467,7787 } },
- { "OLYMPUS E-PL2", 0, 0,
- { 15030,-5552,-1806,-3987,12387,1767,-592,1670,7023 } },
- { "OLYMPUS E-PL3", 0, 0,
- { 7575,-2159,-571,-3722,11341,2725,-1434,2819,6271 } },
+ { "OLYMPUS E-P1", 0, 0xffd, /* RT - Colin Walker */
+ { 8834,-2344,-804,-4691,12503,2448,-978,1919,7603 } },
+ { "OLYMPUS E-P2", 0, 0xffd, /* RT - Colin Walker */
@ -409,10 +458,10 @@
+ { 11975,-3351,-1184,-4500,12639,2061,-1230,2353,7009 } },
+ { "OLYMPUS E-PL3", 0, 0, /* RT - Colin Walker */
+ { 7041,-1794,-336,-3790,11192,2984,-1364,2625,6217 } },
{ "OLYMPUS E-PM1", 0, 0,
{ 7575,-2159,-571,-3722,11341,2725,-1434,2819,6271 } },
{ "OLYMPUS SP350", 0, 0,
{ 12078,-4836,-1069,-6671,14306,2578,-786,939,7418 } },
{ "OLYMPUS SP3", 0, 0,
@@ -6607,8 +6630,8 @@
@@ -6616,8 +6637,8 @@
{ 10915,-3677,-982,-5587,12986,2911,-1168,1968,6223 } },
{ "OLYMPUS SP570UZ", 0, 0,
{ 11522,-4044,-1146,-4736,12172,2904,-988,1829,6039 } },
@ -423,7 +472,7 @@
{ "PENTAX *ist DL2", 0, 0,
{ 10504,-2438,-1189,-8603,16207,2531,-1022,863,12242 } },
{ "PENTAX *ist DL", 0, 0,
@@ -6683,30 +6706,32 @@
@@ -6692,6 +6713,8 @@
{ 10909,-4295,-948,-1333,9306,2399,22,1738,4582 } },
{ "LEICA D-LUX 5", 143, 0,
{ 10909,-4295,-948,-1333,9306,2399,22,1738,4582 } },
@ -432,7 +481,8 @@
{ "Panasonic DMC-FZ100", 143, 0xfff,
{ 16197,-6146,-1761,-2393,10765,1869,366,2238,5248 } },
{ "LEICA V-LUX 2", 143, 0xfff,
{ 16197,-6146,-1761,-2393,10765,1869,366,2238,5248 } },
@@ -6700,24 +6723,24 @@
{ 11904,-4541,-1189,-2355,10899,1662,-296,1586,4289 } },
{ "Panasonic DMC-FX150", 15, 0xfff,
{ 9082,-2907,-925,-6119,13377,3058,-1797,2641,5609 } },
- { "Panasonic DMC-G10", 0, 0,
@ -441,14 +491,14 @@
- { 8199,-2065,-1056,-8124,16156,2033,-2458,3022,7220 } },
- { "Panasonic DMC-G2", 15, 0xf3c,
- { 10113,-3400,-1114,-4765,12683,2317,-377,1437,6710 } },
- { "Panasonic DMC-G3", 143, 0xfff, /* DJC */
- { 6460,-2578,-366,-2786,8728,4059,-1073,2525,6254 } },
- { "Panasonic DMC-G3", 143, 0xfff,
- { 6763,-1919,-863,-3868,11515,2684,-1216,2387,5879 } },
- { "Panasonic DMC-GF1", 15, 0xf92,
- { 7888,-1902,-1011,-8106,16085,2099,-2353,2866,7330 } },
- { "Panasonic DMC-GF2", 143, 0xfff,
- { 7888,-1902,-1011,-8106,16085,2099,-2353,2866,7330 } },
- { "Panasonic DMC-GF3", 143, 0xfff, /* DJC */
- { 8407,-3261,-502,-3997,10651,3347,-1095,2742,7294 } },
- { "Panasonic DMC-GF3", 143, 0xfff,
- { 9051,-2468,-1204,-5212,13276,2121,-1197,2510,6890 } },
- { "Panasonic DMC-GH1", 15, 0xf92,
- { 6299,-1466,-532,-6535,13852,2969,-2331,3112,5984 } },
- { "Panasonic DMC-GH2", 15, 0xf95,
@ -473,8 +523,8 @@
+ { 6855,-1765,-456,-4223,11600,2996,-1450,2602,5761 } },
{ "Phase One H 20", 0, 0, /* DJC */
{ 1313,1855,-109,-6715,15908,808,-327,1840,6020 } },
{ "Phase One P 2", 0, 0,
@@ -6759,26 +6784,28 @@
{ "Phase One H 25", 0, 0,
@@ -6774,24 +6797,20 @@
{ 5932,-1492,-411,-4813,12285,2856,-741,1524,6739 } },
{ "SONY DSLR-A5", 128, 0xfeb,
{ 4950,-580,-103,-5228,12542,3029,-709,1435,7371 } },
@ -486,13 +536,17 @@
{ 5413,-1162,-365,-5665,13098,2866,-608,1179,8440 } },
{ "SONY DSLR-A900", 128, 0,
{ 5209,-1072,-397,-8845,16120,2919,-1618,1803,8654 } },
- { "SONY NEX-5N", 128, 0,
- { 5991,-1456,-455,-4764,12135,2980,-707,1425,6701 } },
- { "SONY NEX-C3", 128, 0,
- { 5991,-1456,-455,-4764,12135,2980,-707,1425,6701 } },
- { "SONY NEX-3", 138, 0, /* DJC */
- { 6907,-1256,-645,-4940,12621,2320,-1710,2581,6230 } },
- { "SONY NEX-5", 116, 0, /* DJC */
- { 6807,-1350,-342,-4216,11649,2567,-1089,2001,6420 } },
- { "SONY NEX-C3", 128, 0, /* DJC */
- { 5171,-1786,-46,-3375,9315,4061,-611,1865,6473 } },
- { "SONY NEX", 128, 0, /* Adobe's matrix */
- { "SONY NEX-3", 128, 0, /* Adobe */
- { 6549,-1550,-436,-4880,12435,2753,-854,1868,6976 } },
- { "SONY NEX-5", 128, 0, /* Adobe */
- { 6549,-1550,-436,-4880,12435,2753,-854,1868,6976 } },
+ { "SONY NEX-3", 128, 0, /* RT - Colin Walker */
+ { 5145,-741,-123,-4915,12310,2945,-794,1489,6906 } },
@ -504,17 +558,19 @@
+ { 5130,-1055,-269,-4473,11797,3050,-701,1310,7121 } },
{ "SONY SLT-A33", 128, 0,
{ 6069,-1221,-366,-5221,12779,2734,-1024,2066,6834 } },
{ "SONY SLT-A35", 128, 0, /* DJC */
{ 4504,-1495,115,-3507,9101,4407,-669,1844,6806 } },
{ "SONY SLT-A55", 128, 0,
- { 5932,-1492,-411,-4813,12285,2856,-741,1524,6739 } }
+ { 5932,-1492,-411,-4813,12285,2856,-741,1524,6739 } },
+ { "SONY SLT-A77V", 128, 0, /* RT - Colin Walker */
{ "SONY SLT-A35", 128, 0,
@@ -6800,8 +6819,8 @@
{ 5932,-1492,-411,-4813,12285,2856,-741,1524,6739 } },
{ "SONY SLT-A65", 128, 0,
{ 5491,-1192,-363,-4951,12342,2948,-911,1722,7192 } },
- { "SONY SLT-A77", 128, 0,
- { 5491,-1192,-363,-4951,12342,2948,-911,1722,7192 } }
+ { "SONY SLT-A77", 128, 0, /* RT - Colin Walker */
+ { 5126,-830,-261,-4788,12196,2934,-948,1602,7068 } }
};
double cam_xyz[4][3];
char name[130];
@@ -7021,6 +7048,12 @@
@@ -7044,6 +7063,12 @@
fread (head, 1, 32, ifp);
fseek (ifp, 0, SEEK_END);
flen = fsize = ftell(ifp);
@ -527,7 +583,7 @@
if ((cp = (char *) memmem (head, 32, "MMMM", 4)) ||
(cp = (char *) memmem (head, 32, "IIII", 4))) {
parse_phase_one (cp-head);
@@ -7028,6 +7061,8 @@
@@ -7051,6 +7076,8 @@
} else if (order == 0x4949 || order == 0x4d4d) {
if (!memcmp (head+6,"HEAPCCDR",8)) {
data_offset = hlen;
@ -536,7 +592,7 @@
parse_ciff (hlen, flen - hlen);
} else if (parse_tiff(0)) apply_tiff();
} else if (!memcmp (head,"\xff\xd8\xff\xe1",4) &&
@@ -7071,6 +7106,7 @@
@@ -7094,6 +7121,7 @@
fseek (ifp, 100+28*(shot_select > 0), SEEK_SET);
parse_tiff (data_offset = get4());
parse_tiff (thumb_offset+12);
@ -544,7 +600,7 @@
apply_tiff();
} else if (!memcmp (head,"RIFF",4)) {
fseek (ifp, 0, SEEK_SET);
@@ -7116,8 +7152,7 @@
@@ -7139,8 +7167,7 @@
parse_redcine();
load_raw = &CLASS redcine_load_raw;
gamma_curve (1/2.4, 12.92, 1, 4095);
@ -554,16 +610,25 @@
parse_rollei();
else if (!memcmp (head,"PWAD",4))
parse_sinar_ia();
@@ -7172,7 +7207,7 @@
@@ -7195,7 +7222,7 @@
if (height == 3136 && width == 4864) /* Pentax K20D and Samsung GX20 */
{ height = 3124; width = 4688; filters = 0x16161616; }
if (!strcmp(model,"K-r") || !strcmp(model,"K-x"))
if (width == 4352 && (!strcmp(model,"K-r") || !strcmp(model,"K-x")))
- { width = 4309; filters = 0x16161616; }
+/*RT*/ { width = 4308; filters = 0x16161616; }
if (!strcmp(model,"K-5"))
if (width >= 4960 && !strcmp(model,"K-5"))
{ left_margin = 10; width = 4950; filters = 0x16161616; }
if (!strcmp(model,"K-7"))
@@ -8791,13 +8826,13 @@
if (width == 4736 && !strcmp(model,"K-7"))
@@ -8517,7 +8544,7 @@
for (j=0; j < 3; j++) {
for (num = k=0; k < 3; k++)
num += xyzd50_srgb[i][k] * inverse[j][k];
- oprof[pbody[j*3+23]/4+i+2] = num * 0x10000 + 0.5;
+ oprof[pbody[j*3+23]/4+i+2] = num * 0x10000 + 0.5;
}
for (i=0; i < phead[0]/4; i++)
oprof[i] = htonl(oprof[i]);
@@ -8816,13 +8843,13 @@
FORCC ppm [col*colors+c] = curve[image[soff][c]] >> 8;
else FORCC ppm2[col*colors+c] = curve[image[soff][c]];
if (output_bps == 16 && !output_tiff && htons(0x55aa) != 0x55aa)
@ -579,7 +644,7 @@
{
int arg, status=0;
int timestamp_only=0, thumbnail_only=0, identify_only=0;
@@ -8910,7 +8945,7 @@
@@ -8935,7 +8962,7 @@
case 'i': identify_only = 1; break;
case 'c': write_to_stdout = 1; break;
case 'v': verbose = 1; break;
@ -588,7 +653,7 @@
case 'f': four_color_rgb = 1; break;
case 'A': FORC4 greybox[c] = atoi(argv[arg++]);
case 'a': use_auto_wb = 1; break;
@@ -9173,3 +9208,4 @@
@@ -9198,3 +9225,4 @@
}
return status;
}