mirror of
https://github.com/Evolution-X/external_piex
synced 2026-01-27 16:24:09 +00:00
Update PIEX from tip of tree
Add support for Sony ARW 4.0. Fix overflow issue in GetOlympusPreviewImage. Fix issue with Canon RP raw CR3 files. Test: Ran internal tests and eng verified Change-Id: Ib2b9a76f657fd84158f143aa383f07ac0726e932
This commit is contained in:
@@ -183,13 +183,14 @@ class ArwTypeChecker : public TypeChecker {
|
|||||||
// Search for (kSignatureFileTypeSection + kSignatureVersions[i]) in first
|
// Search for (kSignatureFileTypeSection + kSignatureVersions[i]) in first
|
||||||
// requested bytes
|
// requested bytes
|
||||||
const string kSignatureSection("\x00\xb0\x01\x00\x04\x00\x00\x00", 8);
|
const string kSignatureSection("\x00\xb0\x01\x00\x04\x00\x00\x00", 8);
|
||||||
const int kSignatureVersionsSize = 5;
|
const int kSignatureVersionsSize = 6;
|
||||||
const string kSignatureVersions[kSignatureVersionsSize] = {
|
const string kSignatureVersions[kSignatureVersionsSize] = {
|
||||||
string("\x02\x00", 2), // ARW 1.0
|
string("\x02\x00", 2), // ARW 1.0
|
||||||
string("\x03\x00", 2), // ARW 2.0
|
string("\x03\x00", 2), // ARW 2.0
|
||||||
string("\x03\x01", 2), // ARW 2.1
|
string("\x03\x01", 2), // ARW 2.1
|
||||||
string("\x03\x02", 2), // ARW 2.2
|
string("\x03\x02", 2), // ARW 2.2
|
||||||
string("\x03\x03", 2), // ARW 2.3
|
string("\x03\x03", 2), // ARW 2.3
|
||||||
|
string("\x04\x00", 2), // ARW 4.0
|
||||||
};
|
};
|
||||||
bool matched = false;
|
bool matched = false;
|
||||||
for (int i = 0; i < kSignatureVersionsSize; ++i) {
|
for (int i = 0; i < kSignatureVersionsSize; ++i) {
|
||||||
|
|||||||
@@ -283,9 +283,9 @@ bool GetOlympusPreviewImage(StreamInterface* stream,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (raw_processing_ifd.Has(kOlymTagAspectFrame)) {
|
if (raw_processing_ifd.Has(kOlymTagAspectFrame)) {
|
||||||
std::vector<std::uint32_t> aspect_frame(4);
|
std::vector<std::uint32_t> aspect_frame;
|
||||||
if (raw_processing_ifd.Get(kOlymTagAspectFrame, &aspect_frame) &&
|
if (raw_processing_ifd.Get(kOlymTagAspectFrame, &aspect_frame) &&
|
||||||
aspect_frame[2] > aspect_frame[0] &&
|
aspect_frame.size() == 4 && aspect_frame[2] > aspect_frame[0] &&
|
||||||
aspect_frame[3] > aspect_frame[1]) {
|
aspect_frame[3] > aspect_frame[1]) {
|
||||||
preview_image_data->full_width = aspect_frame[2] - aspect_frame[0] + 1;
|
preview_image_data->full_width = aspect_frame[2] - aspect_frame[0] + 1;
|
||||||
preview_image_data->full_height = aspect_frame[3] - aspect_frame[1] + 1;
|
preview_image_data->full_height = aspect_frame[3] - aspect_frame[1] + 1;
|
||||||
|
|||||||
@@ -720,8 +720,8 @@ bool TiffParser::ParseIfd(const std::uint32_t ifd_offset,
|
|||||||
IfdVector* tiff_directory) {
|
IfdVector* tiff_directory) {
|
||||||
std::uint32_t next_ifd_offset;
|
std::uint32_t next_ifd_offset;
|
||||||
TiffDirectory tiff_ifd(static_cast<Endian>(endian_));
|
TiffDirectory tiff_ifd(static_cast<Endian>(endian_));
|
||||||
if (!ParseDirectory(tiff_offset_, ifd_offset, endian_, desired_tags,
|
if (!ParseDirectory(tiff_offset_, ifd_offset, endian_, desired_tags, stream_,
|
||||||
stream_, &tiff_ifd, &next_ifd_offset) ||
|
&tiff_ifd, &next_ifd_offset) ||
|
||||||
!ParseSubIfds(tiff_offset_, desired_tags, max_number_ifds, endian_,
|
!ParseSubIfds(tiff_offset_, desired_tags, max_number_ifds, endian_,
|
||||||
stream_, &tiff_ifd)) {
|
stream_, &tiff_ifd)) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user