diff options
author | Hans-Christoph Steiner <eighthave@users.sourceforge.net> | 2012-12-05 02:17:17 +0000 |
---|---|---|
committer | Hans-Christoph Steiner <eighthave@users.sourceforge.net> | 2012-12-05 02:17:17 +0000 |
commit | e1d6f308227a1014e3ac8edfd69e00da984ca598 (patch) | |
tree | 63c55d0b35dadcf8e61e14f3583f5fdda1981c58 /image.tcl | |
parent | e833953ad21d8aac946e1cad700763bb1dfcc8e0 (diff) |
handle errors opening image file and try to report them to the Pd window
svn path=/trunk/externals/moonlib/; revision=16649
Diffstat (limited to 'image.tcl')
-rw-r--r-- | image.tcl | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/image.tcl b/image.tcl new file mode 100644 index 0000000..7f4f22c --- /dev/null +++ b/image.tcl @@ -0,0 +1,15 @@ + +namespace eval ::moonlib::image:: { +} + +proc ::moonlib::image::configure {obj_id img filename} { + if { [catch {$img configure -file $filename} fid]} { + ::pdwindow::logpost $obj_id 1 "[image]: error reading '$filename':\n$fid\n" + } +} + +proc ::moonlib::image::create_photo {obj_id img filename} { + if { [catch {image create photo $img -file $filename} fid]} { + ::pdwindow::logpost $obj_id 1 "[image]: error reading '$filename':\n$fid\n" + } +} |