How I can get the outpout in a variable (JavaScript or ASP)
Posted: 2010-10-03T14:40:44-07:00
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
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