Is there a way to read/write XMP metadata using imagemagick? - imagemagick

I would like to read/write XMP metadata in JPEG and PNG files.
I'm able to do this using the exiftool
~ $ exiftool -xmp-dc:description="FooBar" sample.png
1 image files updated
~ $ exiftool sample.png | grep "Description"
Description : FooBar
However, I'm not able to read the XMP Metadata using imagemagick
~ $ identify -verbose sample.png | grep "Description"
My reason to write XMP metadata is that so it can be read by Adobe Products.
Question
Is there a way to read/write XMP metadata using imagemagick?

What you want to ask is "does ImageMagick support reading or writing XMP (descriptive) metadata?". The answer to that question, from reading the documentation, is no. ImageMagick reads (almost) all metadata from a file, but not descriptive metadata.
If for some reason you must use ImageMagick to extract XMP metadata, you could try to include a filter. Filters can be configured to process image files, but they are not part of ImageMagick itself.

convert -ping yourimage.jpg XMP:-

Access XMP data can be done as follows:
ImageMagick.XmpProfile xmp = image.GetXmpProfile();
Console.WriteLine("\n\n----> xmp:" + xmp);
if (xmp != null)
{
you have to process the XML data of the XMPs result.
ie. use XPATH or some other XML interface.
}

Related

Convert Dicom Image to JPG

I am trying to convert a dicom file to JPG which I would then use to show as thumbnail for the dicom file. I am using the code below to convert the dicom file but When I execute it I get the following error
'write': no encode delegate for this image format `' # error/constitute.c/WriteImage/1272 (Magick::ImageMagickError)
I am using ruby version 2.7.0 and I have installed ImageMagick 7.1.0-4 and the supportive gems. How to solve this error?
require 'dicom'
require 'rmagick'
include DICOM
dcm = DObject.read("sample.dcm")
image = dcm.image(:frame => 5)
image.normalize.write("test.jpeg");
I had to reinstall ImageMagick-7.1.0-26 along with libgdcm-tools on my system and the above mentioned code worked fine. So Imagemagick needs these additional libraries (libjpeg62-dev, libtiff-dev, libpng-dev, libpng12-0 and libgdcm-tools) to work with these image types. I don't know if this is correct or not but that the problem I was facing has been resolved by following this approach. Here are some of the links which helped me in solving this
Install ImageMagick with JPG TIFF and PNG Delegates
How to configure and build with libgcdm for lossless jpeg conversion
and dicom support

Can we convert a .msg to jpeg using imagemagick?

I need to convert a .msg file to an jpeg image. Can we do it using ImageMagick ?
I tried to run the below command,
magick mail.msg mail.jpeg
but it gives an error :
magick: no decode delegate for this image format `MSG' # error/constitute.c/ReadImage/512.
I need .msg to be converted into an image.
Can you please suggest if that is possible.
Thanks,
Abha

Extract/Convert an (multi-file)image that converted

I have a file made with a program , an image sticker maker .
I know this program saves it's images(probably an image, a bg and a mask) into single file with extension ".adf" .
I couldn't convert the output file with image magick cause of below error :
convert: no decode delegate for this image format `output.adf' # error/constitute.c/ReadImage/532.
I don't know how this Image converted with Image magick .
it's my -list configure result :
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
I attached the file :
src.adf
* EDIT *
if I run file command on src.adf it tells :
root#MexHex-PC:# file -vv src.adf
file-5.25
magic file from /etc/magic:/usr/share/misc/magic
What's missed !?
Thanks
This src.adf looks like a very minimal & flat data file. I know nothing about Dalahoo3D and/or ArcGis products, but we can quickly extract the embedded images with 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()
Which dumps the following three images...
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.
I'm guessing this is just a matter of miscommunication. It's true that ImageMagick commonly handles JPEG / TIFF formats, but not geographic information systems and/or 3D modeling. That's usually extended by a vendor -- like ArcGIS. I would bet that ImageMagick is present in the workflow of generating TIFF files, but .ADF wouldn't be supported by ImageMagick until someone writes a delegate coder.
Update
From 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.

Convert png image fingerprint to minutiae xyt fingerprint format

I am following Minutiae cylinder code paper and it uses ISO19794-2 or xyt format for minutiae. I tried NIST BIOMDI and NBIS. Both didn't work.
Have you tried mindtct distributed with NBIS.
$ ./bin/mindtct -b ./sd09/vol_01/sd09/vol_01/crd_0000f/crd_0000f_01.png ./outf
Will generate a bunch of files including ./outf.xyt.

convert jpeg/png to tiff in java

I am using batik library for image conversion , I need to convert jpeg/png to tiff format.
Can anyone help me on how to do the conversion using batik (preferable) , because i am using the same library for other SVG conversions.
You could probably do PNG - > SVG - > TIFF conversion.
This link should point you in the right direction:
http://xmlgraphics.apache.org/batik/tools/rasterizer.html
check the "Examples of using the rasterizer task" section.
Hope this helps.

Resources