Update PIEX

* Adjust the max thumbnail size to 512 pixel
* Reads the correct full dimensions for DNGs which are stored in DefaultCropSize of the main image
This commit is contained in:
Yujie Qin
2016-04-14 14:40:21 +02:00
parent 2f5d8eafb5
commit be908191d0
2 changed files with 17 additions and 16 deletions

View File

@@ -556,7 +556,22 @@ bool GetFullDimension32(const TiffDirectory& tiff_directory,
}
}
if (tiff_directory.Has(kExifTagWidth) && tiff_directory.Has(kExifTagHeight)) {
if (tiff_directory.Has(kExifTagDefaultCropSize)) {
std::vector<std::uint32_t> crop(2);
std::vector<Rational> crop_rational(2);
if (tiff_directory.Get(kExifTagDefaultCropSize, &crop)) {
*width = crop[0];
*height = crop[1];
} else if (tiff_directory.Get(kExifTagDefaultCropSize, &crop_rational) &&
crop_rational[0].denominator != 0 &&
crop_rational[1].denominator != 0) {
*width = crop_rational[0].numerator / crop_rational[0].denominator;
*height = crop_rational[1].numerator / crop_rational[1].denominator;
} else {
return false;
}
} else if (tiff_directory.Has(kExifTagWidth) &&
tiff_directory.Has(kExifTagHeight)) {
if (!tiff_directory.Get(kExifTagWidth, width) ||
!tiff_directory.Get(kExifTagHeight, height)) {
return false;
@@ -585,20 +600,6 @@ bool GetFullDimension32(const TiffDirectory& tiff_directory,
} else {
return false;
}
} else if (tiff_directory.Has(kExifTagDefaultCropSize)) {
std::vector<std::uint32_t> crop(2);
std::vector<Rational> crop_rational(2);
if (tiff_directory.Get(kExifTagDefaultCropSize, &crop)) {
*width = crop[0];
*height = crop[1];
} else if (tiff_directory.Get(kExifTagDefaultCropSize, &crop_rational) &&
crop_rational[0].denominator != 0 &&
crop_rational[1].denominator != 0) {
*width = crop_rational[0].numerator / crop_rational[0].denominator;
*height = crop_rational[1].numerator / crop_rational[1].denominator;
} else {
return false;
}
}
return true;
}

View File

@@ -28,7 +28,7 @@
namespace piex {
// Specifies the maximum number of pixels for thumbnails in each direction.
const int kThumbnailMaxDimension = 256;
const int kThumbnailMaxDimension = 512;
// Specifies all tags that might be of interest to get the preview data.
enum GpsTags {