diff options
author | Yujie Qin <yujieqin@google.com> | 2016-04-14 13:52:33 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2016-04-14 13:52:33 +0000 |
commit | 89379e54c134bd2ab9d81d21f6b144e805ac0685 (patch) | |
tree | 800b0582f6280d733f14ff084d81c7cb32202ee4 | |
parent | 980d5c4b9b8ed09896622e257edf75fe326d1c03 (diff) | |
parent | 64ab98ef0f174a9ee82bcc73d2660f5903831016 (diff) | |
download | piex-89379e54c134bd2ab9d81d21f6b144e805ac0685.tar.gz |
Update PIEX am: be90819
am: 64ab98e
* commit '64ab98ef0f174a9ee82bcc73d2660f5903831016':
Update PIEX
Change-Id: Ia720d9489673a4ad6d71750f324001915599d528
-rw-r--r-- | src/tiff_parser.cc | 31 | ||||
-rw-r--r-- | src/tiff_parser.h | 2 |
2 files changed, 17 insertions, 16 deletions
diff --git a/src/tiff_parser.cc b/src/tiff_parser.cc index 697e320..00bb944 100644 --- a/src/tiff_parser.cc +++ b/src/tiff_parser.cc @@ -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; } diff --git a/src/tiff_parser.h b/src/tiff_parser.h index a19b71e..3cb9d7e 100644 --- a/src/tiff_parser.h +++ b/src/tiff_parser.h @@ -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 { |