DNG files from DJI FC6310 open extremely slow, fixes #4888
This commit is contained in:
parent
2696037cb8
commit
ed3b54e4eb
@ -6462,17 +6462,20 @@ guess_cfa_pc:
|
|||||||
unsigned oldOrder = order;
|
unsigned oldOrder = order;
|
||||||
order = 0x4d4d; // always big endian per definition in https://www.adobe.com/content/dam/acom/en/products/photoshop/pdfs/dng_spec_1.4.0.0.pdf chapter 7
|
order = 0x4d4d; // always big endian per definition in https://www.adobe.com/content/dam/acom/en/products/photoshop/pdfs/dng_spec_1.4.0.0.pdf chapter 7
|
||||||
unsigned ntags = get4(); // read the number of opcodes
|
unsigned ntags = get4(); // read the number of opcodes
|
||||||
while (ntags--) {
|
|
||||||
unsigned opcode = get4();
|
if (ntags < ifp->size / 12) { // rough check for wrong value (happens for example with DNG files from DJI FC6310)
|
||||||
fseek (ifp, 8, SEEK_CUR); // skip 8 bytes as they don't interest us currently
|
while (ntags-- && !ifp->eof) {
|
||||||
if (opcode == 4) { // FixBadPixelsConstant
|
unsigned opcode = get4();
|
||||||
fseek (ifp, 4, SEEK_CUR); // skip 4 bytes as we know that the opcode 4 takes 4 byte
|
fseek (ifp, 8, SEEK_CUR); // skip 8 bytes as they don't interest us currently
|
||||||
if(get4() == 0) { // if raw 0 values should be treated as bad pixels, set zero_is_bad to true (1). That's the only value currently supported by rt
|
if (opcode == 4) { // FixBadPixelsConstant
|
||||||
zero_is_bad = 1;
|
fseek (ifp, 4, SEEK_CUR); // skip 4 bytes as we know that the opcode 4 takes 4 byte
|
||||||
|
if(get4() == 0) { // if raw 0 values should be treated as bad pixels, set zero_is_bad to true (1). That's the only value currently supported by rt
|
||||||
|
zero_is_bad = 1;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
fseek (ifp, get4(), SEEK_CUR);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
fseek (ifp, get4(), SEEK_CUR);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
order = oldOrder;
|
order = oldOrder;
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user