Standard output

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
proxykillah

Standard output

Post by proxykillah »

hi

im trying to redirect the -debug "all" from the standard output
it doesn't seem to be output on this and instead gets dumped to the console
so i tried redirecting the standard error and then i get nothing (nothing on console either)

this could be a mono issue, but its strange none the less, is this info not outputed on the std output

here is a code extract
thanks

examples args

Code: Select all

-resize 100% -flop -flip -border 5x5 -bordercolor "#ff0000" -verbose -debug "all"

Code: Select all

using System;
using Gtk;
using System.Text;
using System.IO;
using System.Diagnostics;
using System.Threading;
using System.ComponentModel;

public partial class MainWindow: Gtk.Window
{	
	
	private System.Diagnostics.Process processInstance;
	private StreamWriter avimergeStreamWriter;
	private TextBuffer outbuffer;
	private TextBuffer errorbuffer;
	
	public MainWindow (): base (Gtk.WindowType.Toplevel)
	{
		Build ();
		
		this.hbox1.ModifyBg(StateType.Normal, new Gdk.Color(0x00,0x00,0x00));
		this.image1.Pixbuf = new Gdk.Pixbuf("in.jpg");
		
		outbuffer = this.textview1.Buffer;
		errorbuffer = this.textview2.Buffer;
		
	}
	
	protected void OnDeleteEvent (object sender, DeleteEventArgs a)
	{
		Application.Quit ();
		a.RetVal = true;
	}

	protected virtual void OnButton1Clicked (object sender, System.EventArgs e)
	{
		if(File.Exists("/home/dave/Projects/Mimagemagick/Mimagemagick/bin/Debug/out.jpg"))
		{
			File.Delete("/home/dave/Projects/Mimagemagick/Mimagemagick/bin/Debug/out.jpg");	
		}
		
		this.image1.Pixbuf = null;
		
		string infile = this.entry1.Text;
		string outfile = this.entry2.Text;
		string options = this.entry3.Text;		
		
		this.processInstance = new Process();
        this.processInstance.StartInfo.FileName = "convert";
       	this.processInstance.StartInfo.Arguments = options + " \"" + infile + "\" \"" + outfile +"\"";				
       	this.processInstance.StartInfo.UseShellExecute = false;
        this.processInstance.StartInfo.RedirectStandardOutput = true;
		this.processInstance.StartInfo.RedirectStandardError = true;
		this.processInstance.ErrorDataReceived += HandleErrorDataReceived;
		this.processInstance.OutputDataReceived += HandleOutputDataReceived;
		this.processInstance.StartInfo.RedirectStandardInput = true;
		this.processInstance.Start();
				
		this.avimergeStreamWriter = this.processInstance.StandardInput;
		this.avimergeStreamWriter.AutoFlush = true;
		this.processInstance.BeginOutputReadLine();				   		
		this.processInstance.WaitForExit();

		Console.WriteLine("conversion complete");	
		this.image1.Pixbuf = new Gdk.Pixbuf("/home/dave/Projects/Mimagemagick/Mimagemagick/bin/Debug/out.jpg");
	}
	
	protected void HandleOutputDataReceived(object sender, DataReceivedEventArgs e)
	{
		this.outbuffer.Text += e.Data.ToString();
	}
	
	protected void HandleErrorDataReceived(object sender, DataReceivedEventArgs e)
	{
		this.errorbuffer.Text += e.Data.ToString();
	}
	
}


-verbose results

Code: Select all

/home/dave/Projects/Mimagemagick/Mimagemagick/bin/Debug/in.jpg JPEG 452x610 452x610+0+0 8-bit DirectClass 115kb /home/dave/Projects/Mimagemagick/Mimagemagick/bin/Debug/in.jpg=>/home/dave/Projects/Mimagemagick/Mimagemagick/bin/Debug/out.jpg JPEG 452x610=>462x620 462x620+0+0 8-bit DirectClass 117kb 

expected degug "all" results

Code: Select all

2009-09-05T16:47:44+01:00 0:01 0.000u 6.4.5 Configure convert[5572]: utility.c/ExpandFilenames/808/Configure
  Command line: /usr/bin/convert {-resize} {100%} {-flop} {-flip} {-border} {5x5} {-bordercolor} {#000000} {-verbose} {-debug} {all} {/home/dave/Projects/Mimagemagick/Mimagemagick/bin/Debug/in.jpg} {/home/dave/Projects/Mimagemagick/Mimagemagick/bin/Debug/out.jpg}
2009-09-05T16:47:44+01:00 0:01 0.000u 6.4.5 Configure convert[5572]: configure.c/GetConfigureOptions/528/Configure
  Searching for configure file: "/usr/share/ImageMagick-6.4.5/config/coder.xml"
2009-09-05T16:47:44+01:00 0:01 0.000u 6.4.5 Configure convert[5572]: configure.c/GetConfigureOptions/528/Configure
  Searching for configure file: "/usr/lib/ImageMagick-6.4.5/config/coder.xml"
2009-09-05T16:47:44+01:00 0:01 0.000u 6.4.5 Configure convert[5572]: configure.c/GetConfigureOptions/528/Configure
  Searching for configure file: "/usr/share/doc/ImageMagick-6.4.5/coder.xml"
2009-09-05T16:47:44+01:00 0:01 0.000u 6.4.5 Configure convert[5572]: configure.c/GetConfigureOptions/528/Configure
  Searching for configure file: "/usr/share/ImageMagick-6.4.5/coder.xml"
2009-09-05T16:47:44+01:00 0:01 0.000u 6.4.5 Configure convert[5572]: configure.c/GetConfigureOptions/528/Configure
  Searching for configure file: "/home/dave/.magick/coder.xml"
2009-09-05T16:47:44+01:00 0:01 0.000u 6.4.5 Configure convert[5572]: configure.c/GetConfigureOptions/528/Configure
  Searching for configure file: "coder.xml"
2009-09-05T16:47:44+01:00 0:01 0.000u 6.4.5 Configure convert[5572]: coder.c/LoadCoderList/638/Configure
  Loading coder configuration file "/usr/share/ImageMagick-6.4.5/config/coder.xml" ...
2009-09-05T16:47:44+01:00 0:01 0.000u 6.4.5 Module convert[5572]: module.c/OpenModule/1120/Module
  Searching for module "JPEG" using filename "jpeg.la"
2009-09-05T16:47:44+01:00 0:01 0.000u 6.4.5 Module convert[5572]: module.c/GetMagickModulePath/528/Module
  Searching for coder module file "jpeg.la" ...
2009-09-05T16:47:44+01:00 0:01 0.000u 6.4.5 Module convert[5572]: module.c/OpenModule/1129/Module
  Opening module at path "/usr/lib/ImageMagick-6.4.5/modules-Q16/coders/jpeg.la"
2009-09-05T16:47:44+01:00 0:01 0.000u 6.4.5 Module convert[5572]: module.c/OpenModule/1156/Module
  Method "RegisterJPEGImage" in module "JPEG" at address 0xb7fbba80
2009-09-05T16:47:44+01:00 0:01 0.000u 6.4.5 Module convert[5572]: module.c/OpenModule/1170/Module
  Method "UnregisterJPEGImage" in module "JPEG" at address 0xb7fbba30
2009-09-05T16:47:44+01:00 0:01 0.000u 6.4.5 Blob convert[5572]: blob.c/OpenBlob/2345/Blob
    read 3 magic header bytes
2009-09-05T16:47:44+01:00 0:01 0.000u 6.4.5 Cache convert[5572]: cache.c/DestroyCacheInfo/2202/Cache
  destroy 
2009-09-05T16:47:44+01:00 0:01 0.000u 6.4.5 Configure convert[5572]: configure.c/GetConfigureOptions/528/Configure
  Searching for configure file: "/usr/share/ImageMagick-6.4.5/config/magic.xml"
2009-09-05T16:47:44+01:00 0:01 0.000u 6.4.5 Configure convert[5572]: configure.c/GetConfigureOptions/528/Configure
  Searching for configure file: "/usr/lib/ImageMagick-6.4.5/config/magic.xml"
2009-09-05T16:47:44+01:00 0:01 0.000u 6.4.5 Configure convert[5572]: configure.c/GetConfigureOptions/528/Configure
  Searching for configure file: "/usr/share/doc/ImageMagick-6.4.5/magic.xml"
2009-09-05T16:47:44+01:00 0:01 0.000u 6.4.5 Configure convert[5572]: configure.c/GetConfigureOptions/528/Configure
  Searching for configure file: "/usr/share/ImageMagick-6.4.5/magic.xml"
2009-09-05T16:47:44+01:00 0:01 0.000u 6.4.5 Configure convert[5572]: configure.c/GetConfigureOptions/528/Configure
  Searching for configure file: "/home/dave/.magick/magic.xml"
2009-09-05T16:47:44+01:00 0:01 0.000u 6.4.5 Configure convert[5572]: configure.c/GetConfigureOptions/528/Configure
  Searching for configure file: "magic.xml"
2009-09-05T16:47:44+01:00 0:01 0.000u 6.4.5 Configure convert[5572]: magic.c/LoadMagicList/681/Configure
  Loading magic configure file "/usr/share/ImageMagick-6.4.5/config/magic.xml" ...
2009-09-05T16:47:44+01:00 0:01 0.000u 6.4.5 Blob convert[5572]: blob.c/OpenBlob/2345/Blob
    read 3 magic header bytes
2009-09-05T16:47:44+01:00 0:01 0.000u 6.4.5 Coder convert[5572]: jpeg.c/ReadJPEGImage/845/Coder
  Interlace: nonprogressive
2009-09-05T16:47:44+01:00 0:01 0.000u 6.4.5 Coder convert[5572]: jpeg.c/ReadJPEGImage/847/Coder
  Data precision: 8
2009-09-05T16:47:44+01:00 0:01 0.000u 6.4.5 Coder convert[5572]: jpeg.c/ReadJPEGImage/849/Coder
  Geometry: 452x610
2009-09-05T16:47:44+01:00 0:01 0.000u 6.4.5 Coder convert[5572]: jpeg.c/ReadJPEGImage/930/Coder
  Quality: 100 (approximate)
2009-09-05T16:47:44+01:00 0:01 0.000u 6.4.5 Coder convert[5572]: jpeg.c/ReadJPEGImage/1023/Coder
  Colorspace: RGB
2009-09-05T16:47:44+01:00 0:01 0.000u 6.4.5 Coder convert[5572]: jpeg.c/ReadJPEGImage/1050/Coder
  Sampling Factors: 2x2,1x1,1x1
2009-09-05T16:47:44+01:00 0:01 0.000u 6.4.5 Resource convert[5572]: resource.c/AcquireMagickResource/220/Resource
  Area: 2.104mb/2.104mb/5.9037gb
2009-09-05T16:47:44+01:00 0:01 0.000u 6.4.5 Resource convert[5572]: resource.c/AcquireMagickResource/220/Resource
  Memory: 2.104mb/2.104mb/4.4277gb
2009-09-05T16:47:44+01:00 0:01 0.000u 6.4.5 Cache convert[5572]: cache.c/OpenCache/3615/Cache
  open /home/dave/Projects/Mimagemagick/Mimagemagick/bin/Debug/in.jpg[0] (heap memory, 452x610 2.104mb)
2009-09-05T16:47:44+01:00 0:01 0.040u 6.4.5 Resource convert[5572]: resource.c/AcquireMagickResource/220/Resource
  Area: 2.104mb/2.104mb/5.9037gb
2009-09-05T16:47:44+01:00 0:01 0.040u 6.4.5 Resource convert[5572]: resource.c/AcquireMagickResource/220/Resource
  Memory: 2.104mb/4.207mb/4.4277gb
2009-09-05T16:47:44+01:00 0:01 0.040u 6.4.5 Cache convert[5572]: cache.c/OpenCache/3615/Cache
  open /home/dave/Projects/Mimagemagick/Mimagemagick/bin/Debug/in.jpg[0] (heap memory, 452x610 2.104mb)
2009-09-05T16:47:44+01:00 0:01 0.040u 6.4.5 Cache convert[5572]: cache.c/CloneMemoryToMemoryPixels/1969/Cache
  memory => memory
2009-09-05T16:47:44+01:00 0:01 0.060u 6.4.5 Resource convert[5572]: resource.c/RelinquishMagickResource/854/Resource
  Memory: 2.104mb/2.104mb/4.4277gb
2009-09-05T16:47:44+01:00 0:01 0.060u 6.4.5 Cache convert[5572]: cache.c/DestroyCacheInfo/2202/Cache
  destroy /home/dave/Projects/Mimagemagick/Mimagemagick/bin/Debug/in.jpg[0]
2009-09-05T16:47:44+01:00 0:01 0.060u 6.4.5 Resource convert[5572]: resource.c/AcquireMagickResource/220/Resource
  Area: 2.104mb/2.104mb/5.9037gb
2009-09-05T16:47:44+01:00 0:01 0.060u 6.4.5 Resource convert[5572]: resource.c/AcquireMagickResource/220/Resource
  Memory: 2.104mb/4.207mb/4.4277gb
2009-09-05T16:47:44+01:00 0:01 0.060u 6.4.5 Cache convert[5572]: cache.c/OpenCache/3615/Cache
  open /home/dave/Projects/Mimagemagick/Mimagemagick/bin/Debug/in.jpg[0] (heap memory, 452x610 2.104mb)
2009-09-05T16:47:44+01:00 0:01 0.060u 6.4.5 Cache convert[5572]: cache.c/CloneMemoryToMemoryPixels/1969/Cache
  memory => memory
2009-09-05T16:47:44+01:00 0:01 0.100u 6.4.5 Resource convert[5572]: resource.c/RelinquishMagickResource/854/Resource
  Memory: 2.104mb/2.104mb/4.4277gb
2009-09-05T16:47:44+01:00 0:01 0.100u 6.4.5 Cache convert[5572]: cache.c/DestroyCacheInfo/2202/Cache
  destroy /home/dave/Projects/Mimagemagick/Mimagemagick/bin/Debug/in.jpg[0]
2009-09-05T16:47:44+01:00 0:01 0.100u 6.4.5 Resource convert[5572]: resource.c/AcquireMagickResource/220/Resource
  Area: 2.185mb/2.185mb/5.9037gb
2009-09-05T16:47:44+01:00 0:01 0.100u 6.4.5 Resource convert[5572]: resource.c/AcquireMagickResource/220/Resource
  Memory: 2.185mb/4.289mb/4.4277gb
2009-09-05T16:47:44+01:00 0:01 0.100u 6.4.5 Cache convert[5572]: cache.c/OpenCache/3615/Cache
  open /home/dave/Projects/Mimagemagick/Mimagemagick/bin/Debug/in.jpg[0] (heap memory, 462x620 2.185mb)
2009-09-05T16:47:44+01:00 0:01 0.100u 6.4.5 Cache convert[5572]: cache.c/CloneMemoryToMemoryPixels/1969/Cache
  memory => memory
2009-09-05T16:47:44+01:00 0:01 0.170u 6.4.5 Resource convert[5572]: resource.c/RelinquishMagickResource/854/Resource
  Memory: 2.104mb/2.185mb/4.4277gb
2009-09-05T16:47:44+01:00 0:01 0.180u 6.4.5 Cache convert[5572]: cache.c/DestroyCacheInfo/2202/Cache
  destroy /home/dave/Projects/Mimagemagick/Mimagemagick/bin/Debug/in.jpg[0]
2009-09-05T16:47:44+01:00 0:01 0.180u 6.4.5 Coder convert[5572]: jpeg.c/WriteJPEGImage/1694/Coder
  Image resolution: 72,72
2009-09-05T16:47:44+01:00 0:01 0.180u 6.4.5 Resource convert[5572]: resource.c/AcquireMagickResource/220/Resource
  Memory: 2.185mb/4.371mb/4.4277gb
2009-09-05T16:47:44+01:00 0:01 0.180u 6.4.5 Resource convert[5572]: resource.c/RelinquishMagickResource/854/Resource
  Memory: 2.185mb/2.185mb/4.4277gb
2009-09-05T16:47:44+01:00 0:01 0.180u 6.4.5 Coder convert[5572]: jpeg.c/WriteJPEGImage/1740/Coder
  Interlace: non-progressive
2009-09-05T16:47:44+01:00 0:01 0.180u 6.4.5 Coder convert[5572]: jpeg.c/WriteJPEGImage/1755/Coder
  Quality: 100
2009-09-05T16:47:44+01:00 0:01 0.180u 6.4.5 Coder convert[5572]: jpeg.c/WriteJPEGImage/1795/Coder
    Input sampling-factors=2x2,1x1,1x1
2009-09-05T16:47:44+01:00 0:01 0.180u 6.4.5 Coder convert[5572]: jpeg.c/WriteJPEGImage/1859/Coder
  Storage class: DirectClass
2009-09-05T16:47:44+01:00 0:01 0.180u 6.4.5 Coder convert[5572]: jpeg.c/WriteJPEGImage/1861/Coder
  Depth: 8
2009-09-05T16:47:44+01:00 0:01 0.180u 6.4.5 Coder convert[5572]: jpeg.c/WriteJPEGImage/1867/Coder
  Number of colors: unspecified
2009-09-05T16:47:44+01:00 0:01 0.180u 6.4.5 Coder convert[5572]: jpeg.c/WriteJPEGImage/1869/Coder
  JPEG data precision: 8
2009-09-05T16:47:44+01:00 0:01 0.180u 6.4.5 Coder convert[5572]: jpeg.c/WriteJPEGImage/1923/Coder
   Image colorspace is RGB
2009-09-05T16:47:44+01:00 0:01 0.180u 6.4.5 Coder convert[5572]: jpeg.c/WriteJPEGImage/1925/Coder
  Sampling factors: 2x2,1x1,1x1
2009-09-05T16:47:44+01:00 0:01 0.210u 6.4.5 Resource convert[5572]: resource.c/RelinquishMagickResource/854/Resource
  Memory: 2.185mb/0b/4.4277gb
2009-09-05T16:47:44+01:00 0:01 0.220u 6.4.5 Cache convert[5572]: cache.c/DestroyCacheInfo/2202/Cache
  destroy /home/dave/Projects/Mimagemagick/Mimagemagick/bin/Debug/in.jpg[0]

User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Standard output

Post by fmw42 »

in command line did you try adding 2>&1
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Standard output

Post by anthony »

Or better still if writing to a file add 2>filename

This is a attribute of the calling shell, and not ImageMagick itself. The above suggestions are for Bourne Shell and its deritives such as BASH, KSH and ZSH.

From programs such as PHP other methods may be needed.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply