diff options
author | Nick White <git@njw.name> | 2015-05-21 14:21:48 +0100 |
---|---|---|
committer | Nick White <git@njw.name> | 2015-05-21 14:21:48 +0100 |
commit | 40a422fabd3fe14a83b6a0213fef821614f4c568 (patch) | |
tree | d3f9d2996968a8cd7ba6977007e7adb6a2ab1e5e | |
parent | cdffd29c9105740fdf1604b9c36062e26c544619 (diff) | |
download | tkread-40a422fabd3fe14a83b6a0213fef821614f4c568.tar.bz2 tkread-40a422fabd3fe14a83b6a0213fef821614f4c568.zip |
Don't bail if an image can't be read
-rwxr-xr-x | tkread | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -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 |