validators: png signature as bytes

This commit is contained in:
Denis Jacquerye 2015-10-28 08:44:08 +00:00
parent 7cd33cdca7
commit fd8440a223

View File

@ -747,7 +747,7 @@ def pngValidator(path=None, data=None, fileObj=None):
pos = fileObj.tell() pos = fileObj.tell()
signature = fileObj.read(8) signature = fileObj.read(8)
fileObj.seek(pos) fileObj.seek(pos)
if signature != "\x89PNG\r\n\x1a\n": if signature != b"\x89PNG\r\n\x1a\n":
return False, "Image does not begin with the PNG signature." return False, "Image does not begin with the PNG signature."
return True, None return True, None