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.
Powerbuilder & IM
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Powerbuilder & IM
What version of IM do you use now? Is "convert" found at the command line?
snibgo's IM pages: im.snibgo.com
Re: Powerbuilder & IM
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
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.
Re: Powerbuilder & IM
I am sorry the command was:
oMagick.convert(ls_origfile, '-format', 'png', ls_destfile)
oMagick.convert(ls_origfile, '-format', 'png', ls_destfile)
Re: Powerbuilder & IM
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
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