Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Phase One decode error #727

Open
kmilos opened this issue May 29, 2024 · 1 comment
Open

Phase One decode error #727

kmilos opened this issue May 29, 2024 · 1 comment

Comments

@kmilos
Copy link
Contributor

kmilos commented May 29, 2024

P25 IIQ sample sample throws

ERROR: [rawspeed] C:/msys64/home/kmilos/rawspeed/src/librawspeed/decompressors/PhaseOneDecompressor.cpp:165: void rawspeed::PhaseOneDecompressor::decompress() const: Too many errors encountered. Giving up. First Error:
C:/msys64/home/kmilos/rawspeed/src/librawspeed/decompressors/PhaseOneDecompressor.cpp:112: void rawspeed::PhaseOneDecompressor::decompressStrip(const rawspeed::PhaseOneStrip&) const: Can not initialize lengths. Data is corrupt.

The P30 and P45 .TIF samples decode fine (as do the P25+ and P45+ .IIQ ones). I can also decode the P25 one using LibRaw's unprocessed_raw tool.

@kmilos kmilos changed the title Phase One P25 sample decode error Phase One decode error Jun 26, 2024
@kmilos
Copy link
Contributor Author

kmilos commented Jun 26, 2024

Also reproduced on iXM-100, IQ3 100MP and IQ4 150MP IIQ L samples as well (after bumping allowed width & height):

diff --git a/src/librawspeed/decoders/IiqDecoder.cpp b/src/librawspeed/decoders/IiqDecoder.cpp
index 9d8b98fd..8eb2962d 100644
--- a/src/librawspeed/decoders/IiqDecoder.cpp
+++ b/src/librawspeed/decoders/IiqDecoder.cpp
@@ -233,8 +233,8 @@ RawImage IiqDecoder::decodeRawInternal() {
     }
   }
 
-  // FIXME: could be wrong. max "active pixels" in "Sensor+" mode - "101 MP"
-  if (width == 0 || height == 0 || width > 11976 || height > 8854)
+  // FIXME: could be wrong. max "active pixels" for IQ4 150MP
+  if (width == 0 || height == 0 || width > 14308 || height > 10760)
     ThrowRDE("Unexpected image dimensions found: (%u; %u)", width, height);
 
   if (!format)
diff --git a/src/librawspeed/decompressors/PhaseOneDecompressor.cpp b/src/librawspeed/decompressors/PhaseOneDecompressor.cpp
index 0172c6a4..da2a335e 100644
--- a/src/librawspeed/decompressors/PhaseOneDecompressor.cpp
+++ b/src/librawspeed/decompressors/PhaseOneDecompressor.cpp
@@ -50,7 +50,7 @@ PhaseOneDecompressor::PhaseOneDecompressor(RawImage img,
     ThrowRDE("Unexpected cpp: %u", mRaw->getCpp());
 
   if (!mRaw->dim.hasPositiveArea() || mRaw->dim.x % 2 != 0 ||
-      mRaw->dim.x > 11976 || mRaw->dim.y > 8854) {
+      mRaw->dim.x > 14308 || mRaw->dim.y > 10760) {
     ThrowRDE("Unexpected image dimensions found: (%u; %u)", mRaw->dim.x,
              mRaw->dim.y);
   }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant