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

Commit

Permalink
Merge branch 'develop' of github.com:klauspost/rawspeed into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
klauspost committed Jan 4, 2015
2 parents bd4b6f4 + eeda37e commit af36d8d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
19 changes: 18 additions & 1 deletion RawSpeed/DngDecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,24 @@ RawImage DngDecoder::decodeRawInternal() {
// Crop
if (raw->hasEntry(ACTIVEAREA)) {
iPoint2D new_size(mRaw->dim.x, mRaw->dim.y);
const uint32 *corners = raw->getEntry(ACTIVEAREA)->getIntArray();

TiffEntry *active_area = raw->getEntry(ACTIVEAREA);
if (active_area->count != 4)
ThrowRDE("DNG: active area has %d values instead of 4", active_area->count);

const uint32 *corners = NULL;
if (active_area->type == TIFF_LONG) {
corners = active_area->getIntArray();
} else if (active_area->type == TIFF_SHORT) {
const ushort16 *short_corners = active_area->getShortArray();
uint32 *tmp = new uint32[4];
for (uint32 i=0; i<4; i++)
tmp[i] = short_corners[i];
corners = tmp;
}
else {
ThrowRDE("DNG: active area has to be LONG or SHORT");
}
if (iPoint2D(corners[1], corners[0]).isThisInside(mRaw->dim)) {
if (iPoint2D(corners[3], corners[2]).isThisInside(mRaw->dim)) {
iRectangle2D crop(corners[1], corners[0], corners[3] - corners[1], corners[2] - corners[0]);
Expand Down
1 change: 1 addition & 0 deletions RawSpeed/RawImage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ ImageMetaData::ImageMetaData(void) {
subsampling.x = subsampling.y = 1;
isoSpeed = 0;
pixelAspectRatio = 1;
fujiRotationPos = 0;
wbCoeffs[0] = NAN;
wbCoeffs[1] = NAN;
wbCoeffs[2] = NAN;
Expand Down

0 comments on commit af36d8d

Please sign in to comment.