#BUGFIX by cg
class: FileApplicationNoteBook::ImageViewApplication class
changed: #canOpenItem:
clicking on a file with an image-file-suffix:
also ask the reader, if the contents is really an image
of that type (in case you encounter a .bm file,
which is not a bitmap)
--- a/FileApplicationNoteBook.st Fri Jan 19 12:26:40 2018 +0100
+++ b/FileApplicationNoteBook.st Fri Jan 19 19:49:35 2018 +0100
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
"
COPYRIGHT (c) 2002 by eXept Software AG
All Rights Reserved
@@ -4189,8 +4191,13 @@
!FileApplicationNoteBook::ImageViewApplication class methodsFor:'queries'!
canOpenItem:anItem
-
- ^ (anItem hasMimeType and:[anItem mimeType isImageType])
+ |mimeType imageReader|
+
+ ^ (anItem hasMimeType
+ and:[(mimeType := anItem mimeType) isImageType
+ "/ do not trust the mimetype - the contents may not correspond to its mimetype...
+ and:[(imageReader := MIMETypes imageReaderForType:mimeType) notNil
+ and:[imageReader isValidImageFile:anItem fileName]]])
!
wantNewApplicationAnyway