convert: no images defined `temp3.tiff' @ error/convert.c/ConvertImageCommand/3273

Magick++ is an object-oriented C++ interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick++.
Post Reply
Rubert
Posts: 3
Joined: 2019-09-03T04:39:52-07:00
Authentication code: 1152

convert: no images defined `temp3.tiff' @ error/convert.c/ConvertImageCommand/3273

Post by Rubert »

I am able to convert PDF image to tiff image from terminal. But I am not able to execute the same command through python or java program. I am getting "convert: no images defined `temp3.tiff' @ error/convert.c/ConvertImageCommand/3273." . Any suggestions on how to resolve it?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: convert: no images defined `temp3.tiff' @ error/convert.c/ConvertImageCommand/3273

Post by snibgo »

What version of IM? What version of Ghostscript? What was your exact command? What is the text output when you insert "-verbose" in the command? Can you convert from other input formats? If so, then I suspect you can't access Ghostscript from within python or java. Perhaps you have a path or privilege problem.
snibgo's IM pages: im.snibgo.com
Rubert
Posts: 3
Joined: 2019-09-03T04:39:52-07:00
Authentication code: 1152

Re: convert: no images defined `temp3.tiff' @ error/convert.c/ConvertImageCommand/3273

Post by Rubert »

Thanks for your response! ImageMagick 7.0.8-59 and gs --> 9.27. Below is my python code. I am able to convert tiff image to PDF using the same code. I think I have problem converting PDF images

Code: Select all

convert_exe_name = '/usr/local/bin/convert'

args = [convert_exe_name, 'File3.pdf', 'temp3.tiff']
proc = subprocess.Popen(args, shell=False)
retcode = proc.wait()
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: convert: no images defined `temp3.tiff' @ error/convert.c/ConvertImageCommand/3273

Post by snibgo »

Can you execute a Ghostscript command from python? Perhaps that need the full path to the GS program. If so, then check your delegates.xml file, and ensure that has the same full path.
snibgo's IM pages: im.snibgo.com
Rubert
Posts: 3
Joined: 2019-09-03T04:39:52-07:00
Authentication code: 1152

Re: convert: no images defined `temp3.tiff' @ error/convert.c/ConvertImageCommand/3273

Post by Rubert »

This command works for me from my mac terminal(gs -sDEVICE=pngalpha -sOutputFile=gs_out.png -r144 git.pdf). I tried to run the same command through python program. I am not getting any error, however I am not seeing output file anywhere. Below is my python code. What I am missing.

Code: Select all

import sys
import locale
import ghostscript

args = [
    "-sDEVICE=pngalpha",
    "-sOutputFile=/Users/z063183/python/ocr/gs_out.png",
    "-r144",
    "/Users/z063183/python/ocr/git.pdf"
    ]

# arguments have to be bytes, encode them
encoding = locale.getpreferredencoding()
args = [a.encode(encoding) for a in args]

ghostscript.Ghostscript(*args)
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: convert: no images defined `temp3.tiff' @ error/convert.c/ConvertImageCommand/3273

Post by snibgo »

I thought you might try running GS with subprocess.Popen(). Anyhow, if you can't run GS from within python, there is no chance of IM running GS within python.

Sorry, I don't know what the problem is or how to fix it. But you might check privileges of the required files.
snibgo's IM pages: im.snibgo.com
Post Reply