Menu

#4 Messages to System.out make PclRenderImage bad for filters

open
nobody
None
5
2010-06-15
2010-06-15
No

While I was working on a small Java program that could convert PCL to PNG files, I found that the class com.openpcl.pclrenderimage.PclRenderImage sends message to System.out from the metods loadFromFileSplitIntoSeparatePclPages() and getImageForPage().

This is makes it impossible to use PclRenderImage-based programs as "filters", intended the UNIX way. E.g. I could not do "PCLToPNG infile.pcl > outfile.png" because the debug messages would get into outfile.png, making it unusable.

I gave a quick look at the code and saw that the debug messages are calls to System.out.println() that cannot be disabled. See for instance com.openpcl.pclrenderimage.tools.PclParser.ParsePCL().

This is not a critical bug, but IMHO it would be better to leave stdout to the calling application, and find other ways for logging and debugging (maybe just using System.err would be a lot better).

Apart from this, OpenPCL is a great project! Thank you!

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.