"gs: symbol lookup error: /lib64/libgs.so.9: undefined symbol: FT_Property_Set" Error when converting .ai file to .png with ghostscript 9.25 - imagemagick

I'm using ImageMagick with ghostscript 9.25 to convert images. When I try to convert .ai file to .png with image magic I'm getting the below error in command line
My command ./convert /home/sample_ai_file2.ai /home/ai_out.png
gs: /opt/software/alfresco-one/common/lib/libtiff.so.5: no version information available (required by /lib64/libgs.so.9)
gs: /opt/software/alfresco-one/common/lib/libjpeg.so.62: no version information available (required by /lib64/libgs.so.9)
gs: symbol lookup error: /lib64/libgs.so.9: undefined symbol: FT_Property_Set
.convert.bin: NoImagesForWrite '-write' '/home/sshtest/ai_out.png' at CLI arg 2 # error/operation.c/CLINoImageOperator/4769.
.convert.bin: NoImageForProperty "%w" # warning/property.c/GetMagickPropertyLetter/2561.
.convert.bin: UnknownImageProperty "%w" # warning/property.c/InterpretImageProperties/3499.
.convert.bin: NoImageForProperty "%h" # warning/property.c/GetMagickPropertyLetter/2449.
.convert.bin: UnknownImageProperty "%h" # warning/property.c/InterpretImageProperties/3499.
.convert.bin: NoImageForProperty "%m" # warning/property.c/GetMagickPropertyLetter/2480.
.convert.bin: UnknownImageProperty "%m" # warning/property.c/InterpretImageProperties/3499.
Does any one know the reason for this error ? I can convert all the other image types without any issue.

I was able to find the cause for the above mentioned issue. The error was due to having two versions of GS installed in my system.
When I install ImageMagick, GS 8.64 is also automatically installed by default, then I have again manually installed GS 9.25.
Removing the GS 9.25 resolved my issue.

Related

imagemagick wmf support on Alpine Linux

I am installing imagemagick on Alpine, which picks up 7.0.10 version of imagemagick.
My primary use is to covert WMF to PNG.
But convert sample.wmf sample.png gives error
convert: no decode delegate for this image format `WMF' # error/constitute.c/ReadImage/572.
convert: no images defined `sample.png' # error/convert.c/ConvertImageCommand/3322.
As per https://www.imagemagick.org/script/formats.php, I also installed libwmf, which does not resolve the issue.
identify -list format | grep WMF does not return any result.
Updated Answer
You are in luck! GraphicsMagick can do it on alpine:latest:
apk add graphicsmagick
gm identify -version
GraphicsMagick 1.3.36 20201226 Q16 http://www.GraphicsMagick.org/
Copyright (C) 2002-2020 GraphicsMagick Group.
Additional copyrights and licenses apply to this software.
See http://www.GraphicsMagick.org/www/Copyright.html for details.
Feature Support:
Native Thread Safe yes
Large Files (> 32 bit) yes
Large Memory (> 32 bit) yes
BZIP no
DPS no
FlashPix no
FreeType yes
Ghostscript (Library) no
JBIG no
JPEG-2000 no
JPEG yes
Little CMS no
Loadable Modules yes
Solaris mtmalloc no
Google perftools tcmalloc no
OpenMP no
PNG yes
TIFF yes
TRIO no
Solaris umem no
WebP yes
WMF yes <--- HERE IT IS
X11 no
XML yes
ZLIB yes
Now do the conversion from WMF to PNG:
gm convert sample.wmf result.png
Original Answer
I don't think you'll be able to do that, with ImageMagick at least...
I tried installing libwmf on alpine:latest and then installing ImageMagick from source and it declined to use libwmf v0.2.12
So I checked what ImageMagick requires and it wants libwmf v0.2.8.2.
So I tried alpine:3.8 which can install libwmf v0.2.8.4 but ImageMagick still wouldn't accept that (xxx/ipa.h is missing).
So I looked back to alpine:3.3 and alpine:3.4 and they have no libwmf.
So I tried alpine:3.5 and that was the same libwmf version as alpine:3.8
TLDR; alpine:3.5's libwmf is too new for ImageMagick and alpine:3.4 doesn't have libwmf at all.
Note: I found the packages and versions of libwmf on this website.

ImageMagick generates corrupted PDF file

When I try to convert an image to PDF using ImageMagick by executing the command
mogrify -format pdf ImageMagick.png
the resulting PDF is corrupted. When I try to open it using MuPDF it fails:
error: cannot recognize version marker
warning: trying to repair broken xref
warning: repairing PDF document
error: name too long
warning: skipping ahead to next token
error: invalid key in dict
error: invalid key in dict
error: name too long
warning: skipping ahead to next token
error: no objects found
mupdf: error: cannot open document
The output of ImageMagick using the -verbose-flag is:
ImageMagick.png PNG 600x621 600x621+0+0 8-bit sRGB 123261B 0.020u 0:00.009
ImageMagick.png=>ImageMagick.pdf PNG 600x621 600x621+0+0 8-bit sRGB 122974B 0.070u 0:00.060
The problem with the PDF file seems to be, that the first bytes of the file aren't %PDF-.
This is my input-file
And this is the resulting PDF
My system:
Arch Linux
ImageMagick 7.0.8-8 Q16 x86_64 2018-08-01 (installed by executing pacman -S imagemagick)
The problem was, that ghostscript wasn't installed. ImageMagick doesn't seem to throw an error when ghostscript isn't installed.
To install ghostscript use
pacman -S ghostscript
Your command is just rewriting a PNG over itself. I don't know how the ImageMagick.pdf file was generated, but it really is just a PNG image with a PDF filename. Try one of the following...
convert ImageMagick.png ImageMagick.pdf
... or ...
mogrify -format PDF -path ./ ImageMagick.png

ImageMagick:: Throwing DLL error --> IM_MOD_RL_PNG_.dll': The specified module could not be found

I am trying to run a simple comparison ROBOT FrameWork Script. Here is the script..
*** Settings ***
Library String
Library OperatingSystem
*** Variables ***
${IMAGE_COMPARATOR_COMMAND} D:\\"Program Files"\\ImageMagick-7.0.7-Q8\\convert __REFERENCE__ __TEST__ -metric RMSE -compare -format "%[distortion]" info:
*** Test Cases ***
Image Comparison Ok
Compare Images D:/Project/Lg/imageCompare/CollectorCreation_IE.png D:/Project/Lg/imageCompare/CollectorCreation_Chrome.png # 0.1
#Image Comparison NOk
# Compare Images D:/Project/Lg/imageCompare/CollectorCreation_IE.png D:/Project/Lg/imageCompare/CollectorCreation_Chrome.png 0.1
*** Keywords ***
Compare Images
[Arguments] ${Reference_Image_Path} ${Test_Image_Path} ${Allowed_Threshold}
${TEMP}= Replace String ${IMAGE_COMPARATOR_COMMAND} __REFERENCE__ ${Reference_Image_Path}
log ${TEMP}
${COMMAND}= Replace String ${TEMP} __TEST__ ${Test_Image_Path}
log ${COMMAND}
Log Executing: ${COMMAND}
${RC} ${OUTPUT}= Run And Return Rc And Output ${COMMAND}
Log Return Code: ${RC}
Log Return Output: ${OUTPUT}
${RESULT} Evaluate ${OUTPUT} < ${Allowed_Threshold}
Should be True ${RESULT}
but I ran into issue with dll's. Not sure what is the issue.
Return Output: convert: unable to load module 'd:\Program Files\ImageMagick-7.0.7-Q8\modules\coders\IM_MOD_RL_PNG_.dll': The specified module could not be found.
# error/module.c/OpenModule/1275.
convert: no decode delegate for this image format `PNG' # error/constitute.c/ReadImage/509.
convert: unable to load module 'd:\Program Files\ImageMagick-7.0.7-Q8\modules\coders\IM_MOD_RL_PNG_.dll': The specified module could not be found.
# error/module.c/OpenModule/1275.
convert: no decode delegate for this image format `PNG' # error/constitute.c/ReadImage/509.
convert: unable to open image '#': No such file or directory # error/blob.c/OpenBlob/3323.
convert: unable to open image '#': No such file or directory # error/blob.c/OpenBlob/3323.
convert: no decode delegate for this image format `' # error/constitute.c/ReadImage/509.
convert: no images defined `info:' # error/convert.c/ConvertImageCommand/3275.
I could see this dll in the given location bt program is not able to pick.
I am using Windows 7 64 bit machine and i installed "ImageMagick-7.0.7-14-Q16-x64-dll.exe" and got above issue and tried with "ImageMagick-7.0.7-14-Q8-x64-dll.exe" (i am picking from here) same result.
Can some one help me out with issue. I am guessing it would be issue with the installed version.
C:\Users\bbanduch>magick -version
Version: ImageMagick 7.0.7-14 Q8 x64 2017-12-06 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2015 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Visual C++: 180040629
Features: Cipher DPC Modules OpenMP
Delegates (built-in): bzlib cairo flif freetype gslib jng jp2 jpeg lcms lqr openexr pangocairo png ps raw rsvg tiff webp xml zlib

ImageMagick NegativeOrZeroImageSize .emf

I'm using Wine on Ubuntu 16.04 and ImageMagick-7.0.3-5-portable-Q16-x64 to convert .emf files to .png.
The .emf file is 44.8 MB and has dimensions 3264x2448
I'm using the following from inside the portable folder:
wine convert.exe ../test.emf ../test.png
which errors with:
fixme:ver:GetCurrentPackageId (0x23b850 (nil)): stub
convert.exe: NegativeOrZeroImageSize `../test.emf' # error/image.c/SetImageExtent/2453.
convert.exe: NoImagesDefined `../test.png' # error/convert.c/ConvertImageCommand/3253.
So perhaps it's failing to get the size of the emf?
wine identify.exe -ping -format '%w %h' ../test.emf
Which errors with
identify.exe: NegativeOrZeroImageSize `../test.emf' # error/image.c/SetImageExtent/2453.
Note, I ran indentify.exe on a test ../test.jpg image and it worked correctly so I know the paths are correct.

Can't install GhostScript in ImageMagick

Download latest version of ImageMagick. Unpacked it. Installing Ghostscript like this:
$ sudo apt-get install ghostscript
After that try to configure ImageMagick:
$ ./configure --with-gslib
$ make
$ make install
After that i try to conver PDF to jpg
$ sudo /usr/local/bin/convert in.pdf out.jpg
And i see this mistake
convert: no decode delegate for this image format `/tmp/magick-BzHdr4Kp-00000001' # error/constitute.c/ReadImage/544.
convert: Postscript delegate failed `in.PDF': Нет такого файла или каталога # error/pdf.c/ReadPDFImage/678.
convert: no images defined `out.jpg' # error/convert.c/ConvertImageCommand/3044.
What i'm doing wrong?
Try the following convert commands to see more precisely what's possibly going wrong:
convert a.pdf -debug coder a.jpg
convert a.pdf -debug all a.jpg
There will possibly be a lot of output going to stderr. Amongst the lines you may see where IM is looking for Ghostscript. Also, try
convert -list delegate
convert -list delegate | grep --color -E '(eps|pdf)'
to find with which exact commandlines ImageMagick tries to run Ghostscript (it may call gsx instead of gs, or it may look for it in /usr/local/bin/...). If you find any deviations from your real Ghostscript installation, you can possibly fix it by editing delegates.xml.
convert -list configure
will show you how ImageMagick is configured (and if, for example, gs was during compile-time in the list in DELEGATES variables). Here you also find where to look for delegates.xml:
convert -list configure | grep CONFIGURE_PATH
should list the directory where this (as well as some more) *.xml settings files are located which control how convert et al. behave...

Resources