435ea7
diff --git a/magic/Magdir/images b/magic/Magdir/images
435ea7
index e94905c..a25d292 100644
435ea7
--- a/magic/Magdir/images
435ea7
+++ b/magic/Magdir/images
435ea7
@@ -32,17 +32,42 @@
435ea7
 
435ea7
 # PBMPLUS images
435ea7
 # The next byte following the magic is always whitespace.
435ea7
-0	search/1	P1		Netpbm PBM image text
435ea7
+# strength is changed to try these patterns before "x86 boot sector"
435ea7
+0	search/1	P1		
435ea7
+>3	regex		=[0-9]*\ [0-9]*		Netpbm PBM image text
435ea7
+>3	regex		=[0-9]+\ 		\b, size = %sx
435ea7
+>>3	regex		=\ [0-9]+	\b%s
435ea7
+!:strength + 45
435ea7
 !:mime	image/x-portable-bitmap
435ea7
-0	search/1b	P2		Netpbm PGM image text
435ea7
+0	search/1	P2		
435ea7
+>3	regex		=[0-9]*\ [0-9]*		Netpbm PGM image text
435ea7
+>3	regex		=[0-9]+\ 		\b, size = %sx
435ea7
+>>3	regex		=\ [0-9]+	\b%s
435ea7
+!:strength + 45
435ea7
 !:mime	image/x-portable-greymap
435ea7
 0	search/1	P3		Netpbm PPM image text
435ea7
+>3	regex		=[0-9]*\ [0-9]*		Netpbm PPM image text
435ea7
+>3	regex		=[0-9]+\ 		\b, size = %sx
435ea7
+>>3	regex		=\ [0-9]+	\b%s
435ea7
+!:strength + 45
435ea7
 !:mime	image/x-portable-pixmap
435ea7
-0	string		P4		Netpbm PBM "rawbits" image data
435ea7
+0	string		P4		
435ea7
+>3	regex		=[0-9]*\ [0-9]*		Netpbm PBM "rawbits" image data
435ea7
+>3	regex		=[0-9]+\ 		\b, size = %sx
435ea7
+>>3	regex		=\ [0-9]+	\b%s
435ea7
+!:strength + 45
435ea7
 !:mime	image/x-portable-bitmap
435ea7
-0	string		P5		Netpbm PGM "rawbits" image data
435ea7
+0	string		P5		
435ea7
+>3	regex		=[0-9]*\ [0-9]*		Netpbm PGM "rawbits" image data
435ea7
+>3	regex		=[0-9]+\ 		\b, size = %sx
435ea7
+>>3	regex		=\ [0-9]+	\b%s
435ea7
+!:strength + 45
435ea7
 !:mime	image/x-portable-greymap
435ea7
-0	string		P6		Netpbm PPM "rawbits" image data
435ea7
+0	string		P6		
435ea7
+>3	regex		=[0-9]*\ [0-9]*		Netpbm PPM "rawbits" image data
435ea7
+>3	regex		=[0-9]+\ 		\b, size = %sx
435ea7
+>>3	regex		=\ [0-9]+	\b%s
435ea7
+!:strength + 45
435ea7
 !:mime	image/x-portable-pixmap
435ea7
 0	string		P7		Netpbm PAM image file
435ea7
 !:mime	image/x-portable-pixmap