--- a/PNGReader.st Thu May 16 19:32:28 2019 +0200
+++ b/PNGReader.st Sun May 19 20:18:30 2019 +0200
@@ -1,5 +1,3 @@
-"{ Encoding: utf8 }"
-
"
COPYRIGHT (c) 1996 by Claus Gittinger
All Rights Reserved
@@ -145,6 +143,25 @@
!PNGReader class methodsFor:'testing'!
+file:filename hasSpecialChunk:chunkTag
+ "true if there is a special chunk with chunkTag in filename"
+
+ |pngReader hasChunk|
+
+ hasChunk := false.
+ pngReader := self new.
+ pngReader extractSpecialChunksOnly:true.
+ pngReader
+ specialChunkHandlerAt:chunkTag
+ put:[:data | hasChunk := true].
+ filename asFilename readingFileDo:[:inStream |
+ pngReader fromStream:inStream.
+ ].
+ ^ hasChunk
+
+ "Created: / 19-05-2019 / 20:15:13 / Claus Gittinger"
+!
+
isValidImageFile:aFileName
"return true, if aFileName contains a PNG image"