no images defined @error/convert.c/ConvertImageCommand/3254

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
evanaad
Posts: 8
Joined: 2017-07-05T09:12:29-07:00
Authentication code: 1151

no images defined @error/convert.c/ConvertImageCommand/3254

Post by evanaad »

My home directory contains a file 'mypic.pdf' consisting of a small image. When executing the following command from my home directory:

Code: Select all

convert -density 300 mypic.pdf -quality 90 mypic.png
the following error displays:

Code: Select all

convert: no images defined 'mypic.png' @error/convert.c/ConvertImageCommand/3254.
***

ImageMagick 7.0.6-0 Q16 x86_64 2017-06-12
macOS Sierra 10.12.5
Last edited by evanaad on 2017-07-05T09:54:25-07:00, edited 1 time in total.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: no images defined @error/convert.c/ConvertImageCommand/3254

Post by fmw42 »

What is your platform? In IM 7 convert is replace by magick. Does that make it work? Do you have all the delegates installed, especially for libpng?

What do you get from

Code: Select all

magick -version
evanaad
Posts: 8
Joined: 2017-07-05T09:12:29-07:00
Authentication code: 1151

Re: no images defined @error/convert.c/ConvertImageCommand/3254

Post by evanaad »

> What is your platform?

macOS Sierra 10.12.5

> Do you have all the delegates installed, especially for libpng?

Don't know. How to check?

> What do you get from

Code: Select all

magick -version

Code: Select all

Version: ImageMagick 7.0.6-0 Q16 x86_64 2017-06-12 http://www.imagemagick.org
Copyright: © 1999-2017 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC HDRI Modules 
Delegates (built-in): bzlib freetype jng jpeg ltdl lzma png tiff xml zlib
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: no images defined @error/convert.c/ConvertImageCommand/3254

Post by fmw42 »

How did you install it -- from source, from binary or from Macports of Homebrew. Please answer my question about what you get from

Code: Select all

magick -version
That will tell me what delegates you have installed. Your error is not about reading the PDF, but writing the output PNG.

Does this work:

Code: Select all

magick -density 300 mypic.pdf -quality 90 mypic.png
IM 7 uses magick, not convert
evanaad
Posts: 8
Joined: 2017-07-05T09:12:29-07:00
Authentication code: 1151

Re: no images defined @error/convert.c/ConvertImageCommand/3254

Post by evanaad »

> How did you install it -- from source, from binary or from Macports of Homebrew.

Homebrew.

> Please answer my question about what you get from

Code: Select all

magick -version
I already did. See my previous answer.

> Does this work:

Code: Select all

magick -density 300 mypic.pdf -quality 90 mypic.png
No, it doesn't. It produces the following error messages:

Code: Select all

magick: no images for write '-write' 'mypic.png' at CLI arg 6 @ error/operation.c/CLINoImageOperator/4771.
magick: no image to apply a property "%w" @ warning/property.c/GetMagickPropertyLetter/2561.
magick: unknown image property "%w" @ warning/property.c/InterpretImageProperties/3499.
magick: no image to apply a property "%h" @ warning/property.c/GetMagickPropertyLetter/2449.
magick: unknown image property "%h" @ warning/property.c/InterpretImageProperties/3499.
magick: no image to apply a property "%m" @ warning/property.c/GetMagickPropertyLetter/2480.
magick: unknown image property "%m" @ warning/property.c/InterpretImageProperties/3499.
Extra information

The problems occur when I execute the command from inside the Emacs text editor. When I execute it from Terminal (the macOS command-line console), the command runs successfully.
Last edited by evanaad on 2017-07-05T11:38:02-07:00, edited 2 times in total.
User avatar
GeeMack
Posts: 718
Joined: 2015-12-01T22:09:46-07:00
Authentication code: 1151
Location: Central Illinois, USA

Re: no images defined @error/convert.c/ConvertImageCommand/3254

Post by GeeMack »

evanaad wrote: 2017-07-05T10:31:19-07:00The problems occur when I execute the command from inside the Emacs text editor. When I execute it from Terminal (the macOS command-line console), the command runs successfully.
Sounds like it might be write permissions on the Emacs default directory. Try the command using the full path for your output image.
evanaad
Posts: 8
Joined: 2017-07-05T09:12:29-07:00
Authentication code: 1151

Re: no images defined @error/convert.c/ConvertImageCommand/3254

Post by evanaad »

> Try the command using the full path for your output image.

The same error displays but with the full path:

Code: Select all

convert: no images defined `/Users/evanaad/mypic.png' @ error/convert.c/ConvertImageCommand/3254.
For those not familiar with Emacs: Emacs has a built-in shell similar to Terminal. I execute the commands in it.
Last edited by evanaad on 2017-07-05T11:28:43-07:00, edited 1 time in total.
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: no images defined @error/convert.c/ConvertImageCommand/3254

Post by Bonzo »

Did not read OP's post properly.
evanaad
Posts: 8
Joined: 2017-07-05T09:12:29-07:00
Authentication code: 1151

Re: no images defined @error/convert.c/ConvertImageCommand/3254

Post by evanaad »

> Sounds like it might be write permissions on the Emacs default directory.

I don't think so:

Code: Select all

echo "Hello, world!" > myfile.txt
works as expected.
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: no images defined @error/convert.c/ConvertImageCommand/3254

Post by Bonzo »

Have you tried a different type of input file; for instance a jpg?

Code: Select all

magick input.jpg output.png
evanaad
Posts: 8
Joined: 2017-07-05T09:12:29-07:00
Authentication code: 1151

Re: no images defined @error/convert.c/ConvertImageCommand/3254

Post by evanaad »

> Have you tried a different type of input file; for instance a jpg?

I have now. The command works with input.gif and input.jpg.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: no images defined @error/convert.c/ConvertImageCommand/3254

Post by fmw42 »

Code: Select all

Delegates (built-in): bzlib freetype jng jpeg ltdl lzma png tiff xml zlib
Your delegates do not show gslib. Do you have Ghostscript installed? Check

Code: Select all

gs --version
Does that return a version number and is it current?

Odd that the message is about png and not pdf!
evanaad
Posts: 8
Joined: 2017-07-05T09:12:29-07:00
Authentication code: 1151

Re: no images defined @error/convert.c/ConvertImageCommand/3254

Post by evanaad »

> Your delegates do not show gslib.

This is the same list of delegates as the one produced in the Terminal, and Image Magick has no problem converting pdf to png in the Terminal.

> Do you have Ghostscript installed? Check

Code: Select all

gs --version
When run from the Terminal, the output is

Code: Select all

9.21
When run from Emacs, the output is

Code: Select all

/bin/bash: gs: command not found
evanaad
Posts: 8
Joined: 2017-07-05T09:12:29-07:00
Authentication code: 1151

Re: no images defined @error/convert.c/ConvertImageCommand/3254

Post by evanaad »

I've added the path to the gs executable to the Emacs search path, by adding the following lines to my Emacs init file (~/.emacs) and restarting Emacs:

Code: Select all

(setenv "PATH" (concat (getenv "PATH") ":/usr/local/bin/"))
(setq exec-path (append exec-path '("/usr/local/bin/")))
Now Image Magick can convert pdf to png from Emacs, and my original problem is solved!

Thanks everyone.
tnaughts
Posts: 1
Joined: 2017-07-07T07:39:57-07:00
Authentication code: 1151

Re: no images defined @error/convert.c/ConvertImageCommand/3254

Post by tnaughts »

I am running into a similar issue in converting a pdf into an image. I am trying to convert a pdf to a jpeg image using Rmagick. I am running into some trouble with the following code:

Code: Select all

pdf_link = "https://staging.shurpa.com/deliveries/BtrPsIxl/label.pdf"

file = Tempfile.new(['order', '.jpeg'])
    p pdf_link
    p file.path 
    im = ImageList.new(pdf_link)
    puts "SUPP"
    im.write(file.path.to_s)
    
I recieve this error:

Code: Select all

"https://staging.shurpa.com/deliveries/BtrPsIxl/label.pdf"
"/var/folders/qm/yk_w5d9545j_6wqk6100dhjm0000gq/T/order20170706-43294-
15myct1.png"

Magick::ImageMagickError: unable to open file `/var/folders/qm/yk_w5d9545j_6wqk6100dhjm0000gq/T/magick-43294MCNyzIu4Oenn': No such file or directory @ error/constitute.c/ReadImage/544from/Users/timnaughton/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rmagick-2.16.0/lib/rmagick_internal.rb:1616:in `read'
However the code works perfectly fine when I feed it this pdf_string:

Code: Select all

"https://shippo-delivery-east.s3.amazonaws.com/b2a3e1cd070748cd80b492aa421832a3.pdf?Signature=nf6woycGiOydPI8eSnLcq3r0tEc%3D&Expires=1530816480&AWSAccessKeyId=AKIAJGLCC5MYLLWIG42A"



Version: ImageMagick 6.9.8-10 Q16 x86_64 2017-06-12 http://www.imagemagick.org
Copyright: © 1999-2017 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC Modules
Delegates (built-in): bzlib freetype jng jpeg ltdl lzma png tiff xml zlib
Post Reply