From 1ffdef42a78be9dcb00fb8203651982c09f12ca6 Mon Sep 17 00:00:00 2001 From: Marco De Donno Date: Wed, 12 Jun 2019 16:36:53 +0200 Subject: [PATCH] Dont allow the TGA format in the auto-decoding of the str images --- NIST/fingerprint/functions.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/NIST/fingerprint/functions.py b/NIST/fingerprint/functions.py index 048a5c3..c19a085 100644 --- a/NIST/fingerprint/functions.py +++ b/NIST/fingerprint/functions.py @@ -224,6 +224,9 @@ def changeFormatImage( input, outformat, **options ): buff = StringIO( input ) img = Image.open( buff ) + if img.format in [ "TGA" ]: + raise Exception + except: if string_to_hex( input[ 0 : 4 ] ) in [ "FFA0FFA4", "FFA0FFA5", "FFA0FFA6", "FFA0FFA2", "FFA0FFA8" ]: img = RAWToPIL( WSQ().decode( input ), **options ) -- GitLab