Skip to content
This repository has been archived by the owner on Jul 22, 2018. It is now read-only.

Commit

Permalink
Respect samplesperpixel even if this is a CFA image.
Browse files Browse the repository at this point in the history
Fixes decoding of Fujifilm FinePix X10 DNG, but note that images are delivered with 2 samples per pixel, which will likely need adjustments to work in your application.

Fixes Issue #45.
  • Loading branch information
klauspost committed Jan 4, 2015
1 parent af36d8d commit 8bff993
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions RawSpeed/DngDecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,11 @@ RawImage DngDecoder::decodeRawInternal() {
// Now load the image
if (compression == 1) { // Uncompressed.
try {
if (!mRaw->isCFA)
{
uint32 cpp = raw->getEntry(SAMPLESPERPIXEL)->getInt();
if (cpp > 4)
ThrowRDE("DNG Decoder: More than 4 samples per pixel is not supported.");
mRaw->setCpp(cpp);
}
uint32 cpp = raw->getEntry(SAMPLESPERPIXEL)->getInt();
if (cpp > 4)
ThrowRDE("DNG Decoder: More than 4 samples per pixel is not supported.");
mRaw->setCpp(cpp);

uint32 nslices = raw->getEntry(STRIPOFFSETS)->count;
TiffEntry *TEoffsets = raw->getEntry(STRIPOFFSETS);
TiffEntry *TEcounts = raw->getEntry(STRIPBYTECOUNTS);
Expand Down Expand Up @@ -238,9 +236,7 @@ RawImage DngDecoder::decodeRawInternal() {
try {
// Let's try loading it as tiles instead

if (!mRaw->isCFA) {
mRaw->setCpp(raw->getEntry(SAMPLESPERPIXEL)->getInt());
}
mRaw->setCpp(raw->getEntry(SAMPLESPERPIXEL)->getInt());
mRaw->createData();

if (sample_format != 1)
Expand Down

0 comments on commit 8bff993

Please sign in to comment.