summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick White <git@njw.name>2015-05-21 14:21:48 +0100
committerNick White <git@njw.name>2015-05-21 14:21:48 +0100
commit40a422fabd3fe14a83b6a0213fef821614f4c568 (patch)
treed3f9d2996968a8cd7ba6977007e7adb6a2ab1e5e
parentcdffd29c9105740fdf1604b9c36062e26c544619 (diff)
downloadtkread-40a422fabd3fe14a83b6a0213fef821614f4c568.tar.bz2
tkread-40a422fabd3fe14a83b6a0213fef821614f4c568.zip
Don't bail if an image can't be read
-rwxr-xr-xtkread3
1 files changed, 1 insertions, 2 deletions
diff --git a/tkread b/tkread
index 9b8cc6c..0991dcc 100755
--- a/tkread
+++ b/tkread
@@ -167,8 +167,7 @@ proc markup {widget} {
$widget delete [indexmovechar $altstart "- 2"] [indexmovechar $srcend "+ 1"]
set insertion [indexmovechar $altstart "- 2"]
set localfile [file tail $src]
- if [file exists $localfile] {
- set curimg [image create photo -file $localfile]
+ if { [file exists $localfile] && ! [catch { set curimg [image create photo -file $localfile] }] } {
set imgcache($curimg) [image create photo]
$imgcache($curimg) copy $curimg
set imgshrunk($curimg) 0