Python Converting ORF to jpg - LibRawFatalError: Input/output error

Python Converting ORF to jpg - LibRawFatalError: Input/output error

我正在尝试使用 python 将照片目录从 ORF 转换为 jpg。我使用的图片库是

https://github.com/letmaik/rawpy

当我尝试从路径中读取图像时出现错误。错误如下

  with rawpy.imread(fullPath) as raw:
  File "/Library/Python/2.7/site-packages/rawpy/__init__.py", line 20, in imread
    d.open_file(pathOrFile)
  File "rawpy/_rawpy.pyx", line 266, in rawpy._rawpy.RawPy.open_file
  File "rawpy/_rawpy.pyx", line 668, in rawpy._rawpy.RawPy.handle_error
rawpy._rawpy.LibRawFatalError: Input/output error

imageConversion.py

path = '/Users/Account/Desktop/ORFImages'
for (dirpath, dirnames, filenames) in walk(path):
    for l in filenames:
         fullPath = str(join(dirpath,l))
         with rawpy.imread(fullPath) as raw: #ERROR OCCURS HERE
             rgb = raw.postprocess()
             imageio.imwrite('test.jpg', rgb)

在全路径变量中肯定有 ORF 图像。

我做错了什么?

这段代码适合我。

请注意,路径应该是相对于您拥有的 .py 文件。

import glob
import rawpy
import imageio

path = "ORFImages/*orf"
for infile in glob.glob(path):
    with rawpy.imread(infile) as raw:
        rgb = raw.postprocess()
        imageio.imwrite('test.jpg', rgb)