ImageMagick Webp identified as VIDEO - imagemagick

ImageMagick version: 7.1.0-4
Operating system: Ubuntu 20.04.2 LTS
Description
Extracted AppImage downloaded from (https://download.imagemagick.org/ImageMagick/download/binaries/magick) identify webp as VIDEO
./AppRun identify -debug ALL -ping WEBP_500kB.webp
identify: no decode delegate for this image format `VIDEO' # error/constitute.c/ReadImage/572.
WEBP_500kB.zip
error.log
version.log
delegates.log
Steps to Reproduce
Download AppImage from => https://download.imagemagick.org/ImageMagick/download/binaries/magick
Extract AppImage => ./magick --appimage-extract
Rename squashfs-root folder to => magickdir
cd magickdir
./AppRun identify -debug ALL -ping WEBP_500kB.webp

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 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.

.CDR to .SVG Convert Using ImageMagick

I am on CentOS 6.4 and trying to convert .CDR to .SVG Convert Using ImageMagick using SSH command.
my 1.cdr file is in /var/www/vhosts/website.com/httpdocs/test/1.cdr
once converted to SVG it should be created in the same folder
Tried the following command:
convert /var/www/vhosts/website.com/httpdocs/test/1.cdr image.svg
The Error I am getting is:
sh: mplayer: command not found convert: Delegate failed "mplayer"
"%i" -really-quiet -ao null -vo png:z=3' #
delegate.c/InvokeDelegate/1032. convert: missing an image filename
image.svg' # convert.c/ConvertImageCommand/2800.
Not sure what does that mean ?
In order to convert CDR files you need to install uniconvertor for CDR delegate.
List of all delegates:
convert -list delegate
By default it outputs:
cdr => "uniconvertor" "%i" "%o.svg"; mv "%o.svg" "%o"
Install uniconvertor. For example, on Ubuntu it’s:
sudo apt-get install python-uniconvertor
Then run:
convert image.cdr -flatten -thumbnail '512x512' image.png
Or, with zoom cropping:
convert image.cdr -flatten -thumbnail '512x512^' -gravity center -crop 512x512+0+0 +repage image.png
And you’re done.
I convert to PNG here but you may use your own output format.
python-uniconvertor is part of inkscape.
It does not exist by itself.
Ubuntu/Mint recently removed all the old Python stuff, for Corel Draw I have to fire up the WinXP VM & Corel and export something Linux understands, usually PNG, a favourite
CDR & WMF files are pretty much dead to Linux, ImageMagick can still handle WMF though.

Image not recognized by the 'identify' command

I'm trying to upload some photos into my Rails app. But I'm getting:
Paperclip::NotIdentifiedByImageMagickError in Admin::ImagesController#create
C:/Users/Dwayne/stream20110816-3680-1hm9dag-0.jpeg is not recognized by the 'identify' command.
I know this has been asked before. I thought I'd give my side of the story though, be a bit more verbose than the others, and in doing so help increase awareness of this terrible tragedy.
What platform are you on?
# uname
CYGWIN_NT-6.1-WOW64
Is ImageMagick installed?
# identify
Version: ImageMagick 6.4.0 01/19/10 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2008 ImageMagick Studio LLC
Where is it?
# which identify
/usr/bin/identify
Tell that to Paperclip:
# config/environments/development.rb
Paperclip.options[:command_path] = "/usr/bin"
See if all the files and folders work:
# identify C:/Users/Dwayne/stream20110817-1264-1xuum8v-0.jpg
stream20110817-1264-1xuum8v-0.jpg JPEG 249x262 249x262+0+0 PseudoClass 256c 8-bit 9.88281kb
# identify /cygdrive/c/Users/Dwayne/stream20110817-1264-1xuum8v-0.jpg
stream20110817-1264-1xuum8v-0.jpg JPEG 249x262 249x262+0+0 PseudoClass 256c 8-bit 9.88281kb
Try the same from within the Rails console:
# irb(main):005:0> system("identify C:/Users/Dwayne/stream20110817-1264-1xuum8v-0.jpg")
C:/Users/Dwayne/stream20110817-1264-1xuum8v-0.jpg JPEG 360x360 360x360+0+0 DirectClass 8-bit 32.3281kb
=> true
Still nothing?
Take it to Paperclip's GitHub.
Still nothing?
Hope that somebody here might know.
Courtesy of Travis Pessetto:
Uninstall ImageMagick for Cygwin, install ImageMagick for Windows and try again!

Resources