validators: png signature as bytes
This commit is contained in:
parent
7cd33cdca7
commit
fd8440a223
@ -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
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user