FileApplicationNoteBook.st
changeset 17950 d63391605406
parent 17900 fafb77eead65
child 17951 ea5c9eaf94de
--- 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