get verbose return using com object and .net
Posted: 2017-09-22T12:04:38-07:00
I have been using C# (on windows) to run the imagemagick com object for years now, and it works so well.
Recently, I needed to know how much the virtual canvas "expanded" when I did a 4 point affine distort.
The easy answer is to add -verbose and look at the output.
That works fine when testing in dos window, but it seems the output when using c# is not the same.
The typical code in c# to run the IM object is:
ImageMagickObject.MagickImage img = new ImageMagickObject.MagickImage();
DoProgress("Rubbersheeting...");
object ret1 = img.Convert(allargs.ToArray());
that ret1 variable will be a string with verbose values comma delimited.
Its only giving me like "3456,2446,PNG" though, not what I need.
I know how to use the .Identify method of imobject to get image info, and that works when I need it.
In this case though, I need to get virtual canvas info out at the same time I do the distort, as I +repage the image in that distort sequence.
I do not want to:
1) convert distort without +repage
2) identify to get canvas props
3) run convert again to repage the image.
Getting the canvas info out in one step is the goal, and it seems the .convert method does not capture it in the return variable.
Any ideas?
Recently, I needed to know how much the virtual canvas "expanded" when I did a 4 point affine distort.
The easy answer is to add -verbose and look at the output.
That works fine when testing in dos window, but it seems the output when using c# is not the same.
The typical code in c# to run the IM object is:
ImageMagickObject.MagickImage img = new ImageMagickObject.MagickImage();
DoProgress("Rubbersheeting...");
object ret1 = img.Convert(allargs.ToArray());
that ret1 variable will be a string with verbose values comma delimited.
Its only giving me like "3456,2446,PNG" though, not what I need.
I know how to use the .Identify method of imobject to get image info, and that works when I need it.
In this case though, I need to get virtual canvas info out at the same time I do the distort, as I +repage the image in that distort sequence.
I do not want to:
1) convert distort without +repage
2) identify to get canvas props
3) run convert again to repage the image.
Getting the canvas info out in one step is the goal, and it seems the .convert method does not capture it in the return variable.
Any ideas?