]> granicus.if.org Git - file/commitdiff
Debian#799352 gives an example where text gets mis-detected as PNM:
authorChristos Zoulas <christos@zoulas.com>
Tue, 5 Jul 2016 19:12:21 +0000 (19:12 +0000)
committerChristos Zoulas <christos@zoulas.com>
Tue, 5 Jul 2016 19:12:21 +0000 (19:12 +0000)
$ echo P1788 | file -
/dev/stdin: , bitmap, ASCII text

From Christoph Biedl

magic/Magdir/images

index d25e34820a6d30745bbb935c9c112015cf3ceaa5..41c6cd6190334b5c286dd13395de461a8da4a036 100644 (file)
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: images,v 1.115 2016/03/16 14:41:39 christos Exp $
+# $File: images,v 1.116 2016/03/23 15:29:20 christos Exp $
 # images:  file(1) magic for image formats (see also "iff", and "c-lang" for
 # XPM bitmaps)
 #
 >>>&0  regex           =[0-9]{1,50}                    \b %s
 
 0      search/1        P1              
->0     use             netpbm
->>0    string          x       \b, bitmap
+>0     regex/4         P1\\s
+>>0    use             netpbm
+>>>0   string          x       \b, bitmap
 !:strength + 45
 !:mime image/x-portable-bitmap
 
 0      search/1        P2              
->0     use             netpbm
->>0    string          x       \b, greymap
+>0     regex/4         P2\\s
+>>0    use             netpbm
+>>>0   string          x       \b, greymap
 !:strength + 45
 !:mime image/x-portable-greymap
 
 0      search/1        P3
->0     use             netpbm
->>0    string          x       \b, pixmap
+>0     regex/4         P3\\s
+>>0    use             netpbm
+>>>0   string          x       \b, pixmap
 !:strength + 45
 !:mime image/x-portable-pixmap
 
 0      string          P4              
->0     use             netpbm
->>0    string          x       \b, rawbits, bitmap
+>0     regex/4         P4\\s
+>>0    use             netpbm
+>>>0   string          x       \b, rawbits, bitmap
 !:strength + 45
 !:mime image/x-portable-bitmap
 
 0      string          P5              
->0     use             netpbm
->>0    string          x       \b, rawbits, greymap
+>0     regex/4         P5\\s
+>>0    use             netpbm
+>>>0   string          x       \b, rawbits, greymap
 !:strength + 45
 !:mime image/x-portable-greymap
 
 0      string          P6              
->0     use             netpbm
->>0    string          x       \b, rawbits, pixmap
+>0     regex/4         P6\\s
+>>0    use             netpbm
+>>>0   string          x       \b, rawbits, pixmap
 !:strength + 45
 !:mime image/x-portable-pixmap