Extract/Convert 转换后的(多文件)图像
Extract/Convert an (multi-file)image that converted
我有一个用图像贴纸制作程序制作的文件。
我知道这个程序将它的图像(可能是图像、背景图和蒙版)保存到扩展名为“.adf”的单个文件中。
由于以下错误,我无法使用图像魔术转换输出文件:
convert: no decode delegate for this image format `output.adf' @ error/constitute.c/ReadImage/532.
我不知道这个图像是如何用图像魔法转换的。
这是我的 -list 配置结果:
Path: [built-in]
Name Value
-------------------------------------------------------------------------------
NAME ImageMagick
Path: configure.xml
Name Value
-------------------------------------------------------------------------------
CC vs10
COPYRIGHT Copyright (C) 1999-2011 ImageMagick Studio LLC
DELEGATES bzlib freetype jpeg jp2 lcms png tiff x11 xml wmf zlib
FEATURES OpenMP
HOST Windows
LIB_VERSION 0x671
LIB_VERSION_NUMBER 6,7,1,0
NAME ImageMagick
RELEASE_DATE 2011-07-15
VERSION 6.7.1
WEBSITE http:// www.image magick.org
我附加了文件:
src.adf
* 编辑 *
如果我在 src.adf 上 运行 文件命令它告诉:
root@MexHex-PC:# file -vv src.adf
file-5.25
magic file from /etc/magic:/usr/share/misc/magic
错过了什么!?
谢谢
这个 src.adf
看起来像一个非常小的平面数据文件。我对 Dalahoo3D and/or ArcGis 产品一无所知,但我们可以使用 python.
快速提取嵌入的图像
import struct
with open('src.adf', 'rb') as f:
# Calculate file size.
f.seek(0, 2)
total_bytes = f.tell()
# Rewind to beging.
f.seek(0)
file_cursor = f.tell()
image_cursor = 0
while file_cursor < total_bytes:
# Can for start of JPEG.
if f.read(1) == b"\xFF":
if f.read(3) == b"\xD8\xFF\xE0":
print("JPEG FOUND!")
# Backup and find the size of the image
f.seek(-8, 1)
payload_size = struct.unpack('<I', f.read(4))[0]
# Write image to disk
d_filename = 'image{0}.jpeg'.format(image_cursor)
with open(d_filename, 'wb') as d:
d.write(f.read(payload_size))
image_cursor += 1
else:
f.seek(-3, 1) # Back cursor up, and try again.
file_cursor = f.tell()
转储以下三个图像...
I'm sure this file was made with Imagemagick. I had already seen that one would convert the file to tiff image. He told me to do this with Imagemagick but did not explain the method.
我猜这只是沟通不畅的问题。的确,ImageMagick 通常处理 JPEG / TIFF 格式,但不能处理地理信息系统 and/or 3D 建模。这通常由供应商扩展——比如 ArcGIS。我敢打赌 ImageMagick 存在于生成 TIFF 文件的工作流程中,但 ImageMagick 直到 someone writes a delegate coder.
才支持 .ADF
更新
来自 this question, it looks like you'll need to extend ImageMagick delegates to call GDAL utilities. You'll need to update the delegates.xml file to call the correct utility.
我有一个用图像贴纸制作程序制作的文件。 我知道这个程序将它的图像(可能是图像、背景图和蒙版)保存到扩展名为“.adf”的单个文件中。
由于以下错误,我无法使用图像魔术转换输出文件:
convert: no decode delegate for this image format `output.adf' @ error/constitute.c/ReadImage/532.
我不知道这个图像是如何用图像魔法转换的。 这是我的 -list 配置结果:
Path: [built-in]
Name Value
-------------------------------------------------------------------------------
NAME ImageMagick
Path: configure.xml
Name Value
-------------------------------------------------------------------------------
CC vs10
COPYRIGHT Copyright (C) 1999-2011 ImageMagick Studio LLC
DELEGATES bzlib freetype jpeg jp2 lcms png tiff x11 xml wmf zlib
FEATURES OpenMP
HOST Windows
LIB_VERSION 0x671
LIB_VERSION_NUMBER 6,7,1,0
NAME ImageMagick
RELEASE_DATE 2011-07-15
VERSION 6.7.1
WEBSITE http:// www.image magick.org
我附加了文件: src.adf
* 编辑 * 如果我在 src.adf 上 运行 文件命令它告诉:
root@MexHex-PC:# file -vv src.adf
file-5.25
magic file from /etc/magic:/usr/share/misc/magic
错过了什么!? 谢谢
这个 src.adf
看起来像一个非常小的平面数据文件。我对 Dalahoo3D and/or ArcGis 产品一无所知,但我们可以使用 python.
import struct
with open('src.adf', 'rb') as f:
# Calculate file size.
f.seek(0, 2)
total_bytes = f.tell()
# Rewind to beging.
f.seek(0)
file_cursor = f.tell()
image_cursor = 0
while file_cursor < total_bytes:
# Can for start of JPEG.
if f.read(1) == b"\xFF":
if f.read(3) == b"\xD8\xFF\xE0":
print("JPEG FOUND!")
# Backup and find the size of the image
f.seek(-8, 1)
payload_size = struct.unpack('<I', f.read(4))[0]
# Write image to disk
d_filename = 'image{0}.jpeg'.format(image_cursor)
with open(d_filename, 'wb') as d:
d.write(f.read(payload_size))
image_cursor += 1
else:
f.seek(-3, 1) # Back cursor up, and try again.
file_cursor = f.tell()
转储以下三个图像...
I'm sure this file was made with Imagemagick. I had already seen that one would convert the file to tiff image. He told me to do this with Imagemagick but did not explain the method.
我猜这只是沟通不畅的问题。的确,ImageMagick 通常处理 JPEG / TIFF 格式,但不能处理地理信息系统 and/or 3D 建模。这通常由供应商扩展——比如 ArcGIS。我敢打赌 ImageMagick 存在于生成 TIFF 文件的工作流程中,但 ImageMagick 直到 someone writes a delegate coder.
才支持.ADF
更新
来自 this question, it looks like you'll need to extend ImageMagick delegates to call GDAL utilities. You'll need to update the delegates.xml file to call the correct utility.