Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Imagemagick: no images defined (for output filename)

Tags:

imagemagick

I'm trying to to do a basic convert:

$ convert image.png out.jpg

but getting error

convert-im6.q16: no images defined `out.jpg' @ error/convert.c/ConvertImageCommand/3258.

Why does it say "no images defined" if out.jpg is output image name?

$ ls
image.png
$ convert -version
Version: ImageMagick 6.9.10-23 Q16 x86_64 20190101 https://imagemagick.org
Copyright: © 1999-2019 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC Modules OpenMP
Delegates (built-in): bzlib djvu fftw fontconfig freetype jbig jng jpeg lcms lqr ltdl lzma openexr pangocairo png tiff webp wmf x xml zlib
like image 891
Pavel Avatar asked Jan 24 '26 13:01

Pavel


2 Answers

I had the same issue and found the solution here: https://askubuntu.com/a/1195393.

In my case, the image I was trying to convert had dimensions that were larger than the ImageMagick policy limits. To fix this, go to /etc/ImageMagick/policy.xml and edit the the following lines:

<policy domain="resource" name="width" value="10KP"/>
<policy domain="resource" name="height" value="10KP"/>

value is currently set to 10KP=10,000 pixels, so if your image is larger than that it won't be recognized by ImageMagick. Change value to be larger than the dimensions of the image you are working with.

like image 164
ryan.hausen Avatar answered Jan 26 '26 05:01

ryan.hausen


replace your policy.xml with the code below, solved my case.

!!!! it will bypass any limit because no limit policy given.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policymap [
  <!ELEMENT policymap (policy)*>
  <!ATTLIST policymap xmlns CDATA #FIXED ''>
  <!ELEMENT policy EMPTY>
  <!ATTLIST policy xmlns CDATA #FIXED '' domain NMTOKEN #REQUIRED
    name NMTOKEN #IMPLIED pattern CDATA #IMPLIED rights NMTOKEN #IMPLIED
    stealth NMTOKEN #IMPLIED value CDATA #IMPLIED>
]>
<policymap>
  <policy domain="Undefined" rights="none"/>
</policymap>

like image 22
Rıdvan Avatar answered Jan 26 '26 06:01

Rıdvan