Thursday, November 18, 2010

Another distraction?

I regularly use ImageMagick to post-process documents scanned under the control of a Tcl script using the exec command. All works well, albeit a little slowly. So, I thought that I'd get a copy of TclMagick which didn't compile and so on and so on.... So, I thought that I'd put together my own package using those commands that I use most regularly. I'm so pleased with the result that I think I'll abandon the pixbufFilter module that I was experimenting with in favour of this new approach. I have the package running and able to implement the processes much more quickly than calling the convert command. What I need to explore now, however, is how to pipe GdkPixbuf data across to a wand object. -I think I see how this was done in TkMagic!

Here's the test script -oddly, the command to get an image height is really slow, why?

# test-gnoclWand.tcl

#!/bin/sh
# the next line restarts using tclsh \
exec tclsh "$0" "$@"

package require Gnocl
package require GnoclWand
set pb1 [gnocl::wand load pelican.png]

$pb1 swirl 1200
$pb1 resize 400 400
$pb1 save resize.png

set pb2 [gnocl::wand load image-0007.pnm]
$pb2 deskew
$pb2 save skew.tif
#puts "width = [$pb2 width]"
#puts "height = [$pb2 height]"

No comments: