Skip to content

Commit

Permalink
fix: Updated fix for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
sethk4783 committed Sep 16, 2024
1 parent 394f977 commit f01cead
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions filestack/mixins/imagetransformation.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,10 @@ def auto_image(self):

def doc_to_images(self, pages=None, engine=None, format=None, quality=None, density=None, hidden_slides=None):
return self._add_transform_task('doc_to_images', locals())

def smart_crop(self, mode=None, width=None, height=None, fill_color=None, coords=None):
return self._add_transform_task('smart_crop', locals())

def pdfcreate(self, engine=None):
return self._add_transform_task('pdfcreate', locals())

Expand Down
2 changes: 1 addition & 1 deletion filestack/uploads/intelligent_ingestion.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def upload_part(apikey, filename, filepath, filesize, storage, start_response, p
payload = payload_base.copy()
payload.update({
'size': len(chunk_data),
'md5': b64encode(hashlib.md5(chunk_data).digest()).strip().decode('utf-8'),
'md5': b64encode(hashlib.md5(chunk_data, usedforsecurity=False).digest()).strip().decode('utf-8'),
'offset': offset,
'fii': True
})
Expand Down
6 changes: 3 additions & 3 deletions filestack/uploads/multipart.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def upload_chunk(apikey, filename, storage, start_response, chunk):
'apikey': apikey,
'part': chunk.num,
'size': len(chunk.bytes),
'md5': b64encode(hashlib.md5(chunk.bytes).digest()).strip().decode('utf-8'),
'md5': b64encode(hashlib.md5(chunk.bytes, usedforsecurity=False).digest()).strip().decode('utf-8'),
'uri': start_response['uri'],
'region': start_response['region'],
'upload_id': start_response['upload_id'],
Expand Down Expand Up @@ -113,10 +113,10 @@ def multipart_upload(apikey, filepath, file_obj, storage, params=None, security=
chunks = make_chunks(filepath, file_obj, filesize)
start_response = multipart_request(config.MULTIPART_START_URL, payload, params, security)
upload_func = partial(upload_chunk, apikey, filename, storage, start_response)

with ThreadPoolExecutor(max_workers=upload_processes) as executor:
uploaded_parts = list(executor.map(upload_func, chunks))

location_url = start_response.pop('location_url')
payload.update(start_response)
payload['parts'] = uploaded_parts
Expand Down

0 comments on commit f01cead

Please sign in to comment.