Update with chunks again
This commit is contained in:
parent
cdc033f541
commit
7ba41ca26c
|
@ -116,10 +116,10 @@ def analyze_image(request: Request, image: UploadFile):
|
|||
base_url = re.sub(r'\/images\/?$', '/analyzed_images/', str(request.url))
|
||||
infile = incoming_dir / image.filename
|
||||
file_hash = hashlib.sha256()
|
||||
file_hash.update(image)
|
||||
with open(infile, "w") as f:
|
||||
chunk = image.read(buffer_size)
|
||||
while chunk:
|
||||
file_hash.update(chunk)
|
||||
print ("writing " + buffer_size + " bytes")
|
||||
f.write(chunk)
|
||||
chunk = image.read(buffer_size)
|
||||
|
|
Loading…
Reference in New Issue