"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "core/libs/rawengine/libraw/internal/dcraw_common.cpp" between
digikam-6.2.0.tar.xz and digikam-6.3.0.tar.xz

About: digiKam is an advanced digital photo management application.

dcraw_common.cpp  (digikam-6.2.0.tar.xz):dcraw_common.cpp  (digikam-6.3.0.tar.xz)
skipping to change at line 4280 skipping to change at line 4280
if (hpred[col & 1] >> tiff_bps) if (hpred[col & 1] >> tiff_bps)
derror(); derror();
} }
} }
} }
void CLASS samsung3_load_raw() void CLASS samsung3_load_raw()
{ {
int opt, init, mag, pmode, row, tab, col, pred, diff, i, c; int opt, init, mag, pmode, row, tab, col, pred, diff, i, c;
ushort lent[3][2], len[4], *prow[2]; ushort lent[3][2], len[4], *prow[2];
order = 0x4949; order = 0x4949;
fseek(ifp, 9, SEEK_CUR); fseek(ifp, 9, SEEK_CUR);
opt = fgetc(ifp); opt = fgetc(ifp);
init = (get2(), get2()); init = (get2(), get2());
for (row = 0; row < raw_height; row++) for (row = 0; row < raw_height; row++)
{ {
#ifdef LIBRAW_LIBRARY_BUILD #ifdef LIBRAW_LIBRARY_BUILD
checkCancel(); checkCancel();
#endif #endif
fseek(ifp, (data_offset - ftell(ifp)) & 15, SEEK_CUR); fseek(ifp, (data_offset - ftell(ifp)) & 15, SEEK_CUR);
skipping to change at line 4314 skipping to change at line 4313
if (opt & 2) if (opt & 2)
pmode = 7 - 4 * ph1_bits(1); pmode = 7 - 4 * ph1_bits(1);
else if (!ph1_bits(1)) else if (!ph1_bits(1))
pmode = ph1_bits(3); pmode = ph1_bits(3);
if (opt & 1 || !ph1_bits(1)) if (opt & 1 || !ph1_bits(1))
{ {
FORC4 len[c] = ph1_bits(2); FORC4 len[c] = ph1_bits(2);
FORC4 FORC4
{ {
i = ((row & 1) << 1 | (c & 1)) % 3; i = ((row & 1) << 1 | (c & 1)) % 3;
#ifdef LIBRAW_LIBRARY_BUILD
if(i<0) throw LIBRAW_EXCEPTION_IO_CORRUPT;
#endif
len[c] = len[c] < 3 ? lent[i][0] - '1' + "120"[len[c]] : ph1_bits(4); len[c] = len[c] < 3 ? lent[i][0] - '1' + "120"[len[c]] : ph1_bits(4);
lent[i][0] = lent[i][1]; lent[i][0] = lent[i][1];
lent[i][1] = len[c]; lent[i][1] = len[c];
} }
} }
FORC(16) FORC(16)
{ {
col = tab + (((c & 7) << 1) ^ (c >> 3) ^ (row & 1)); col = tab + (((c & 7) << 1) ^ (c >> 3) ^ (row & 1));
#ifdef LIBRAW_LIBRARY_BUILD
if(col<0) throw LIBRAW_EXCEPTION_IO_CORRUPT;
if(pmode<0) throw LIBRAW_EXCEPTION_IO_CORRUPT;
if(pmode != 7 && row>=2 && (col - '4' + "0224468"[pmode]) < 0 )
throw LIBRAW_EXCEPTION_IO_CORRUPT;
#endif
pred = pred =
(pmode == 7 || row < 2) (pmode == 7 || row < 2)
? (tab ? RAW(row, tab - 2 + (col & 1)) : init) ? (tab ? RAW(row, tab - 2 + (col & 1)) : init)
: (prow[col & 1][col - '4' + "0224468"[pmode]] + prow[col & 1][c ol - '4' + "0244668"[pmode]] + 1) >> 1; : (prow[col & 1][col - '4' + "0224468"[pmode]] + prow[col & 1][c ol - '4' + "0244668"[pmode]] + 1) >> 1;
diff = ph1_bits(i = len[c >> 2]); diff = ph1_bits(i = len[c >> 2]);
if (diff >> (i - 1)) if (diff >> (i - 1))
diff -= 1 << i; diff -= 1 << i;
diff = diff * (mag * 2 + 1) + mag; diff = diff * (mag * 2 + 1) + mag;
RAW(row, col) = pred + diff; RAW(row, col) = pred + diff;
} }
skipping to change at line 5329 skipping to change at line 5337
maximum -= black; maximum -= black;
for (dmin = DBL_MAX, dmax = c = 0; c < 4; c++) for (dmin = DBL_MAX, dmax = c = 0; c < 4; c++)
{ {
if (dmin > pre_mul[c]) if (dmin > pre_mul[c])
dmin = pre_mul[c]; dmin = pre_mul[c];
if (dmax < pre_mul[c]) if (dmax < pre_mul[c])
dmax = pre_mul[c]; dmax = pre_mul[c];
} }
if (!highlight) if (!highlight)
dmax = dmin; dmax = dmin;
FORC4 scale_mul[c] = (pre_mul[c] /= dmax) * 65535.0 / maximum; if(dmax >= 0.00001 && maximum >= 1)
FORC4 scale_mul[c] = (pre_mul[c] /= dmax) * 65535.0 / maximum;
else
FORC4 scale_mul[c] = 1.0;
#ifdef DCRAW_VERBOSE #ifdef DCRAW_VERBOSE
if (verbose) if (verbose)
{ {
fprintf(stderr, _("Scaling with darkness %d, saturation %d, and\nmultipliers "), dark, sat); fprintf(stderr, _("Scaling with darkness %d, saturation %d, and\nmultipliers "), dark, sat);
FORC4 fprintf(stderr, " %f", pre_mul[c]); FORC4 fprintf(stderr, " %f", pre_mul[c]);
fputc('\n', stderr); fputc('\n', stderr);
} }
#endif #endif
if (filters > 1000 && (cblack[4] + 1) / 2 == 1 && (cblack[5] + 1) / 2 == 1) if (filters > 1000 && (cblack[4] + 1) / 2 == 1 && (cblack[5] + 1) / 2 == 1)
{ {
skipping to change at line 9294 skipping to change at line 9305
uchar *table_buf_0x9406; uchar *table_buf_0x9406;
ushort table_buf_0x9406_len = 0; ushort table_buf_0x9406_len = 0;
uchar *table_buf_0x940c; uchar *table_buf_0x940c;
ushort table_buf_0x940c_len = 0; ushort table_buf_0x940c_len = 0;
uchar *table_buf_0x940e; uchar *table_buf_0x940e;
ushort table_buf_0x940e_len = 0; ushort table_buf_0x940e_len = 0;
short morder, sorder = order; short morder, sorder = order;
char buf[10]; char buf[10];
INT64 fsize = ifp->size(); INT64 fsize = ifp->size();
#if LIBRAW_METADATA_LOOP_PREVENTION
if(metadata_blocks++ > LIBRAW_MAX_METADATA_BLOCKS) if(metadata_blocks++ > LIBRAW_MAX_METADATA_BLOCKS)
throw LIBRAW_EXCEPTION_IO_CORRUPT; throw LIBRAW_EXCEPTION_IO_CORRUPT;
#endif
fread(buf, 1, 10, ifp); fread(buf, 1, 10, ifp);
/* /*
printf("===>>buf: 0x"); printf("===>>buf: 0x");
for (int i = 0; i < sizeof buf; i ++) { for (int i = 0; i < sizeof buf; i ++) {
printf("%02x", buf[i]); printf("%02x", buf[i]);
} }
putchar('\n'); putchar('\n');
*/ */
skipping to change at line 9997 skipping to change at line 10010
{ {
stmread(imgdata.shootinginfo.BodySerial, len, ifp); stmread(imgdata.shootinginfo.BodySerial, len, ifp);
} }
else if (tag == 0x022d) else if (tag == 0x022d)
{ {
int wb_ind; int wb_ind;
getc(ifp); getc(ifp);
for (int wb_cnt = 0; wb_cnt < nPentax_wb_list2; wb_cnt++) for (int wb_cnt = 0; wb_cnt < nPentax_wb_list2; wb_cnt++)
{ {
wb_ind = getc(ifp); wb_ind = getc(ifp);
if (wb_ind < nPentax_wb_list2) if (wb_ind >= 0 && wb_ind &lt; nPentax_wb_list2)
FORC4 imgdata.color.WB_Coeffs[Pentax_wb_list2[wb_ind]][c ^ (c >> 1)] = get2(); FORC4 imgdata.color.WB_Coeffs[Pentax_wb_list2[wb_ind]][c ^ (c >> 1)] = get2();
} }
} }
else if (tag == 0x0239) // Q-series lens info (LensInfoQ) else if (tag == 0x0239) // Q-series lens info (LensInfoQ)
{ {
char LensInfo[20]; char LensInfo[20];
fseek(ifp, 12, SEEK_CUR); fseek(ifp, 12, SEEK_CUR);
stread(imgdata.lens.makernotes.Lens, 30, ifp); stread(imgdata.lens.makernotes.Lens, 30, ifp);
strcat(imgdata.lens.makernotes.Lens, " "); strcat(imgdata.lens.makernotes.Lens, " ");
stread(LensInfo, 20, ifp); stread(LensInfo, 20, ifp);
skipping to change at line 10132 skipping to change at line 10145
uchar *table_buf_0x9403; uchar *table_buf_0x9403;
ushort table_buf_0x9403_len = 0; ushort table_buf_0x9403_len = 0;
uchar *table_buf_0x9406; uchar *table_buf_0x9406;
ushort table_buf_0x9406_len = 0; ushort table_buf_0x9406_len = 0;
uchar *table_buf_0x940c; uchar *table_buf_0x940c;
ushort table_buf_0x940c_len = 0; ushort table_buf_0x940c_len = 0;
uchar *table_buf_0x940e; uchar *table_buf_0x940e;
ushort table_buf_0x940e_len = 0; ushort table_buf_0x940e_len = 0;
INT64 fsize = ifp->size(); INT64 fsize = ifp->size();
#if LIBRAW_METADATA_LOOP_PREVENTION
if(metadata_blocks++ > LIBRAW_MAX_METADATA_BLOCKS) if(metadata_blocks++ > LIBRAW_MAX_METADATA_BLOCKS)
throw LIBRAW_EXCEPTION_IO_CORRUPT; throw LIBRAW_EXCEPTION_IO_CORRUPT;
#endif #endif
#endif
/* /*
The MakerNote might have its own TIFF header (possibly with The MakerNote might have its own TIFF header (possibly with
its own byte-order!), or it might just be a table. its own byte-order!), or it might just be a table.
*/ */
if (!strncmp(make, "Nokia", 5)) if (!strncmp(make, "Nokia", 5))
return; return;
fread(buf, 1, 10, ifp); fread(buf, 1, 10, ifp);
/* /*
printf("===>>buf: 0x"); printf("===>>buf: 0x");
skipping to change at line 14667 skipping to change at line 14682
/* /*
Parse a CIFF file, better known as Canon CRW format. Parse a CIFF file, better known as Canon CRW format.
*/ */
void CLASS parse_ciff(int offset, int length, int depth) void CLASS parse_ciff(int offset, int length, int depth)
{ {
int tboff, nrecs, c, type, len, save, wbi = -1; int tboff, nrecs, c, type, len, save, wbi = -1;
ushort key[] = {0x410, 0x45f3}; ushort key[] = {0x410, 0x45f3};
#ifdef LIBRAW_LIBRARY_BUILD #ifdef LIBRAW_LIBRARY_BUILD
INT64 fsize = ifp->size(); INT64 fsize = ifp->size();
#if LIBRAW_METADATA_LOOP_PREVENTION
if(metadata_blocks++ > LIBRAW_MAX_METADATA_BLOCKS) if(metadata_blocks++ > LIBRAW_MAX_METADATA_BLOCKS)
throw LIBRAW_EXCEPTION_IO_CORRUPT; throw LIBRAW_EXCEPTION_IO_CORRUPT;
#endif #endif
#endif
fseek(ifp, offset + length - 4, SEEK_SET); fseek(ifp, offset + length - 4, SEEK_SET);
tboff = get4() + offset; tboff = get4() + offset;
fseek(ifp, tboff, SEEK_SET); fseek(ifp, tboff, SEEK_SET);
nrecs = get2(); nrecs = get2();
if (nrecs<1) return; if (nrecs<1) return;
if ((nrecs | depth) > 127) if ((nrecs | depth) > 127)
return; return;
#ifdef LIBRAW_LIBRARY_BUILD #ifdef LIBRAW_LIBRARY_BUILD
if(nrecs*10 + offset > fsize) return; if(nrecs*10 + offset > fsize) return;
skipping to change at line 17388 skipping to change at line 17405
memset(mask, 0, sizeof mask); memset(mask, 0, sizeof mask);
thumb_offset = thumb_length = thumb_width = thumb_height = 0; thumb_offset = thumb_length = thumb_width = thumb_height = 0;
load_raw = thumb_load_raw = 0; load_raw = thumb_load_raw = 0;
write_thumb = &CLASS jpeg_thumb; write_thumb = &CLASS jpeg_thumb;
data_offset = meta_offset = meta_length = tiff_bps = tiff_compress = 0; data_offset = meta_offset = meta_length = tiff_bps = tiff_compress = 0;
kodak_cbpp = zero_after_ff = dng_version = load_flags = 0; kodak_cbpp = zero_after_ff = dng_version = load_flags = 0;
timestamp = shot_order = tiff_samples = black = is_foveon = 0; timestamp = shot_order = tiff_samples = black = is_foveon = 0;
mix_green = profile_length = data_error = zero_is_bad = 0; mix_green = profile_length = data_error = zero_is_bad = 0;
pixel_aspect = is_raw = raw_color = 1; pixel_aspect = is_raw = raw_color = 1;
tile_width = tile_length = 0; tile_width = tile_length = 0;
#if LIBRAW_METADATA_LOOP_PREVENTION
metadata_blocks = 0; metadata_blocks = 0;
#endif
} }
#endif #endif
/* /*
Identify which camera created this file, and set global variables Identify which camera created this file, and set global variables
accordingly. accordingly.
*/ */
void CLASS identify() void CLASS identify()
{ {
static const short pana[][6] = { static const short pana[][6] = {
skipping to change at line 17751 skipping to change at line 17770
memset(mask, 0, sizeof mask); memset(mask, 0, sizeof mask);
thumb_offset = thumb_length = thumb_width = thumb_height = 0; thumb_offset = thumb_length = thumb_width = thumb_height = 0;
load_raw = thumb_load_raw = 0; load_raw = thumb_load_raw = 0;
write_thumb = &CLASS jpeg_thumb; write_thumb = &CLASS jpeg_thumb;
data_offset = meta_offset = meta_length = tiff_bps = tiff_compress = 0; data_offset = meta_offset = meta_length = tiff_bps = tiff_compress = 0;
kodak_cbpp = zero_after_ff = dng_version = load_flags = 0; kodak_cbpp = zero_after_ff = dng_version = load_flags = 0;
timestamp = shot_order = tiff_samples = black = is_foveon = 0; timestamp = shot_order = tiff_samples = black = is_foveon = 0;
mix_green = profile_length = data_error = zero_is_bad = 0; mix_green = profile_length = data_error = zero_is_bad = 0;
pixel_aspect = is_raw = raw_color = 1; pixel_aspect = is_raw = raw_color = 1;
tile_width = tile_length = 0; tile_width = tile_length = 0;
#if LIBRAW_METADATA_LOOP_PREVENTION
metadata_blocks = 0; metadata_blocks = 0;
#endif
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
{ {
cam_mul[i] = i == 1; cam_mul[i] = i == 1;
pre_mul[i] = i < 3; pre_mul[i] = i < 3;
FORC3 cmatrix[c][i] = 0; FORC3 cmatrix[c][i] = 0;
FORC3 rgb_cam[c][i] = c == i; FORC3 rgb_cam[c][i] = c == i;
} }
colors = 3; colors = 3;
for (i = 0; i < 0x10000; i++) for (i = 0; i < 0x10000; i++)
 End of changes. 15 change blocks. 
3 lines changed or deleted 24 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)