aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans-Christoph Steiner <eighthave@users.sourceforge.net>2012-12-06 03:38:40 +0000
committerHans-Christoph Steiner <eighthave@users.sourceforge.net>2012-12-06 03:38:40 +0000
commite48435d13a4c9ee28ed0dd83bc031a28c53c1741 (patch)
tree765ae6d6464f8bc6c48f43729881dadeb6f49ec8
parente1d6f308227a1014e3ac8edfd69e00da984ca598 (diff)
if image is set to blank, then use filler image and post error message
svn path=/trunk/externals/moonlib/; revision=16650
-rw-r--r--image.c6
-rw-r--r--image.tcl11
2 files changed, 17 insertions, 0 deletions
diff --git a/image.c b/image.c
index 79cb3ac..f95a3e9 100644
--- a/image.c
+++ b/image.c
@@ -48,6 +48,12 @@ void image_drawme(t_image *x, t_glist *glist, int firsttime)
{
if (firsttime)
{
+ if (x->x_image == &s_) // if we have a blank image name, use the included filler
+ {
+ x->x_image = gensym("::moonlib::image::noimage");
+ x->x_type = 1;
+ pd_error(x, "[image]: no image found");
+ }
if(x->x_type)
{
sys_vgui(".x%lx.c create image %d %d -tags %xS\n",
diff --git a/image.tcl b/image.tcl
index 7f4f22c..8bed3dc 100644
--- a/image.tcl
+++ b/image.tcl
@@ -13,3 +13,14 @@ proc ::moonlib::image::create_photo {obj_id img filename} {
::pdwindow::logpost $obj_id 1 "[image]: error reading '$filename':\n$fid\n"
}
}
+
+image create photo ::moonlib::image::noimage -data {
+ R0lGODlhDwARANU8AAAAAP6xDv/yHP6kDP6oCv7FEP/pGUY6J/7KEP7CD//tG/6sCurp6FVLM+/v
+ 7vzhGP7SE/61DtfW05pwG/7ZFXFjOmNWM31yXv65Dv69D/nuIu+9Em5hRmlcO1FELv///1tILLWW
+ I/b29v/kGOubD/7cFteMEYBdJoiAbpKMeJuYjWNXQF9UOrq4stmYEui/FoqEc3VoRZWQfMCBEtbG
+ MO3VHe6qEObUOZiDQ+2wEcJ/EnluWf///wAAAAAAAAAAACH5BAEAADwALAAAAAAPABEAQAa1QJ5Q
+ JIt1Kh1OSiTkNSAQgBRRSEgBgcChKWxdOLsWl5eiKQRoheFBQSQKExjvMsFErtLBYHIRqnAaaAIG
+ axQvFio8Fg94ACWNGB4oIQWVCRFZCwQEeyhCDAcumpwDJgcMXBIVN4FqNSErEkIOCoGCBiNtCBsH
+ DiwPhApqIyUQVRk5HhUUVx8AUVLOASAKGwhUx1mZJAoSFhgZAJgBmgCcILIOBzaYo3okvVwMKycz
+ JjonLKhCQQA7
+}