letmaik / rawpy

📷 RAW image processing for Python, a wrapper for libraw
https://pypi.python.org/pypi/rawpy
MIT License
587 stars 67 forks source link

Problems with postprocessing CR3 format. #173

Closed Munkroe closed 2 years ago

Munkroe commented 2 years ago

The following code works fine for CR2-format, but apparently not for CR3:

for filename in tqdm(os.listdir(rawDirectory)):

    f = os.path.join(rawDirectory, filename)

    with rawpy.imread(f) as raw:

        rgb = raw.postprocess()

It returns the following error:

Traceback (most recent call last):
  File "e:\curveFilters.py", line 27, in <module>
    rgb = raw.postprocess()
  File "rawpy\_rawpy.pyx", line 887, in rawpy._rawpy.RawPy.postprocess
  File "rawpy\_rawpy.pyx", line 790, in rawpy._rawpy.RawPy.dcraw_process
  File "rawpy\_rawpy.pyx", line 438, in rawpy._rawpy.RawPy.ensure_unpack
  File "rawpy\_rawpy.pyx", line 432, in rawpy._rawpy.RawPy.unpack
  File "rawpy\_rawpy.pyx", line 936, in rawpy._rawpy.RawPy.handle_error
rawpy._rawpy.LibRawDataError: b'Corrupted data or unexpected EOF'             

CR3 seems to be supported by LibRaw per version 0.20.1 and rawpy is running LibRaw version 0.20.2, so I assume it's not a version issue.

letmaik commented 2 years ago

I can reproduce that with a sample file from https://mirrorlesscomparison.com/galleries/canon-eos-r-sample-images/. Nothing I can do here though as it would be an issue with libraw. Might be worth asking for help on their forums. Feel free to report back here but I'm going to close the issue as there's nothing to do here for rawpy.