# HG changeset patch # User Claus Gittinger # Date 1516387775 -3600 # Node ID d63391605406ad284adbc73ce880fd9fe2f28dd4 # Parent f4ada786326bd32cc51b9048c41f28433fc9c1d5 #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) diff -r f4ada786326b -r d63391605406 FileApplicationNoteBook.st --- 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