Added image_sha to store image hashes
This commit is contained in:
@@ -1,8 +1,13 @@
|
|||||||
|
import hashlib
|
||||||
|
|
||||||
def buildImage(response, action, outputs):
|
def buildImage(response, action, outputs):
|
||||||
if hasattr(action, "image"):
|
if hasattr(action, "image"):
|
||||||
if response is not None:
|
if response is not None:
|
||||||
imagebytes = response.content
|
image_bytes = response.content
|
||||||
outputs[action.image] = imagebytes
|
outputs[action.image] = image_bytes
|
||||||
|
|
||||||
|
image_sha = hashlib.sha256(image_bytes).hexdigest()
|
||||||
|
outputs[f"{action.image}_hash"] = image_sha
|
||||||
|
|
||||||
else:
|
else:
|
||||||
print("No response received"),
|
print("No response received"),
|
||||||
|
|||||||
Reference in New Issue
Block a user