【发布时间】:2019-07-31 01:12:10
【问题描述】:
我正在使用 wand (MagickWand API 绑定 Python) 来生成尼康原始图像“file.nef”的缩略图。
下面是部分代码:
for arquivo in os.listdir(caminho):
# Se arquivo termina com
if arquivo.endswith(".NEF"):
Inicio = time.time()
caminho_arquivo = caminho + "/" + arquivo
with Image(filename=caminho_arquivo) as img:
Abertura = time.time()
print("Tempo para abrir: {}".format(int(Abertura - Inicio)))
Tempo para abrir = 12s(打开文件的时间!)
搜索 ImageMagick 论坛我发现了这个: http://www.imagemagick.org/
如果你不想打开链接,这里是一份简历:
For a file from a Nikon D800 camera, exiftool shows:
Composite:JpgFromRaw='(Binary data 2307391 bytes, use -b option to extract)'
Composite:OtherImage='(Binary data 918709 bytes, use -b option to extract)'
Composite:PreviewImage='(Binary data 101723 bytes, use -b option to extract)'
ImageMagick can't see these images. They can be extracted by exiftool:
exiftool -JpgFromRaw -b AGA_2983.NEF >fromraw.jpg
exiftool -OtherImage -b AGA_2983.NEF >other.jpg
exiftool -PreviewImage -b AGA_2983.NEF >preview.jpg
这个 exiftool 似乎正是我所需要的。我可以通过 Wand 使用 exiftool 吗?
是否有其他选项可以解决我的问题?
谢谢!
【问题讨论】:
-
ImageMagick 使用 libraw 委托库来读取 RAW 格式。见libraw.org。将代理安装到 ImageMagick 中,它应该允许您从 Canon (CRW) 和 Nikon (NEF) 读取原始格式。安装 ImageMagick 后,它应该可以从 Python Wand 工作。但您可能需要在图像名称前加上 NEF:
-
您可能误解了您发布的链接。 ImageMagick 无法从原始 NEF 中提取缩略图,但您可以读取原始图像并使用 -thumbnail 命令创建缩略图。
-
感谢您的回复。我来看看 libraw
-
欢迎来到 Stack Overflow!如果您可以将您的解决方案添加为答案(并接受它),那就太棒了。它可以帮助其他人更快地找到您的解决方案。
-
@Ricardo 不要在问题标题中添加 SOLVED,而是发布回复并在 2 天内将其标记为正确
标签: python thumbnails wand