How I can get the outpout in a variable (JavaScript or ASP)

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
gerard

How I can get the outpout in a variable (JavaScript or ASP)

Post by gerard »

Hi:
The COM+ code is working well with ImageMagic, I can make a web page and do conversions, etc.

But the real thing that I need to do is get the output (what the program display on the screen) to a variable in ASP or JavaScript

For example the following command line:

compare -metric MAE coaster2711-1a.jpg coaster2711-1b.jpg new.jpg 2>&1

display on the screen:

6.2213 (9.4931e-005)

How I can get this display on a variable at ASP or Javascript?

The Java Code:

Img= new ActiveXObject("ImageMagickObject.MagickImage.1");
Buf = Img.Compare("-metric", "MAE", "c:\\inetpub\\wwwroot\\imagecompare\\coaster2711-1.jpg", "c:\\inetpub\\wwwroot\\imagecompare\\coaster2711-2.jpg", "c:\\inetpub\\wwwroot\\imagecompare\\new.jpg", "2>&1"));

Response.write(Buf);

It doesnt' display the result of Img.Compare (the numbers that show the % of difference), but it create the file new.jpg with differences.

The ASP Code:

Set Img = Server.CreateObject("ImageMagickObject.MagickImage.1")
ret= img.Compare("-metric", "MAE", "c:\inetpub\wwwroot\imagecompare\coaster2711-1a.jpg", "c:\inetpub\wwwroot\imagecompare\coaster2711-1b.jpg", "c:\inetpub\wwwroot\imagecompare\new.jpg","2>&1")

Also create the file new.jpg but doesn't capture the numbers.

How I can get i a variable the result of the compare function?

Thanks very much.
Gerard
dmozealous
Posts: 3
Joined: 2011-12-22T14:27:21-07:00
Authentication code: 8675308

Re: How I can get the outpout in a variable (JavaScript or A

Post by dmozealous »

Hey Gerard,

You ever figure this out? I am running into the same problem and it is seriously bumming me out. Spent about an hour hooking up my scripts to use the COM component, now I got to revert if I can't figure this out.
Post Reply