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 » 2019-09-03T04:49:31-07:00

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: 12032
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 » 2019-09-03T05:04:28-07:00

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 » 2019-09-03T05:23:44-07:00

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: 12032
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 » 2019-09-03T05:36:03-07:00

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 » 2019-09-03T07:10:59-07:00

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: 12032
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 » 2019-09-03T07:21:27-07:00

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