Powerbuilder & IM

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
jagonzo62
Posts: 4
Joined: 2019-02-05T09:19:45-07:00
Authentication code: 1152

Powerbuilder & IM

Post by jagonzo62 » 2019-02-05T09:26:08-07:00

In Powerbuilder I am connecting to ImageMagick using OLE but when I try to executing the convert command I get a message about convert not being found. I've downloaded many versions of IM without any luck. I found that it use to work in version IM6.5.9...Q16. This old version is no longer available.
Please help.

snibgo
Posts: 11809
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Powerbuilder & IM

Post by snibgo » 2019-02-05T10:11:04-07:00

What version of IM do you use now? Is "convert" found at the command line?
snibgo's IM pages: im.snibgo.com

jagonzo62
Posts: 4
Joined: 2019-02-05T09:19:45-07:00
Authentication code: 1152

Re: Powerbuilder & IM

Post by jagonzo62 » 2019-02-05T10:55:41-07:00

Hello,
I downloaded all the versions from the Imagemagick site. Ones with convert and ones without. The ones that were static and dynamic. Version 6 & 7. It's odd. I've used similar commands like below to connect to Word or Excel. I am using Powerbuilder 2017 R3. The last version of Imagemagick I downloaded was ImageMagick-7.0.8-Q8.

I can connect to the Imagemagick process:

OLEObject oMagick
oMagick = Create OLEObject
oMagick.ConnectToNewObject ('ImageMagickObject.MagickImage.1')

but this command fails:
oMagick.object.ImagickImage.convert(ls_origfile, '-format', 'png', ls_destfile)

Thanks
Last edited by jagonzo62 on 2019-02-05T12:45:21-07:00, edited 1 time in total.

jagonzo62
Posts: 4
Joined: 2019-02-05T09:19:45-07:00
Authentication code: 1152

Re: Powerbuilder & IM

Post by jagonzo62 » 2019-02-05T10:56:17-07:00

I am sorry the command was:

oMagick.convert(ls_origfile, '-format', 'png', ls_destfile)

jagonzo62
Posts: 4
Joined: 2019-02-05T09:19:45-07:00
Authentication code: 1152

Re: Powerbuilder & IM

Post by jagonzo62 » 2019-05-08T09:06:16-07:00

I figured out how to adjoin a bunch of tifs into one big tif file using Powerbuilder:

Here's how I connect to imagick in Powerbuilder:

OLEObject oMagick
oMagick = Create OLEObject
oMagick.ConnectToNewObject ('ImageMagickObject.MagickImage.1')

ls_orgfile = ls_folder_with_files + '\*.tif' // ls_folder_with_files is a variable containing the name of the folder (c:\temp\folder1) that contains the tifs I want to join together.

ls_destfile= ls_consolidated_file_name // ls_consolidated_file_name is a variable containing the path and file name of the new consolidated file (c:\temp\file.tif).

// Its was the *.tif that tells imagemagick to get all the files in the folder (ls_folder_with_files ) and join them together and copy the internal file to the new file (ls_consolidated_file_name).

try

la_result= ioMagick.Convert('-adjoin', ls_orgfile , ls_destfile ) // <======================

CATCH (OLERuntimeError ole_e1)
ls_error = ole_e1.getmessage()
gnv_app.inv_error.of_Message("Error", "ioMagick.Convert command call in of_create_consolidated_packet() function failed", exclamation!)
CATCH (Exception ex1)
ls_error = ex1.getmessage()
gnv_app.inv_error.of_Message("Error", ls_error, exclamation!)
Finally
Destroy ioMagick
end try

Post Reply