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