aboutsummaryrefslogtreecommitdiff
path: root/image.tcl
diff options
context:
space:
mode:
authorHans-Christoph Steiner <eighthave@users.sourceforge.net>2012-12-05 02:17:17 +0000
committerHans-Christoph Steiner <eighthave@users.sourceforge.net>2012-12-05 02:17:17 +0000
commite1d6f308227a1014e3ac8edfd69e00da984ca598 (patch)
tree63c55d0b35dadcf8e61e14f3583f5fdda1981c58 /image.tcl
parente833953ad21d8aac946e1cad700763bb1dfcc8e0 (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.tcl15
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"
+ }
+}