We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 99d62a3 commit 4368ee2Copy full SHA for 4368ee2
src/mock_vws/_mock_web_query_api.py
@@ -106,13 +106,12 @@ def validate_image_file_size(
106
107
image_file = io.BytesIO(image)
108
pil_image = Image.open(image_file)
109
- file_size_bytes = len(pil_image.tobytes())
110
111
if pil_image.format != 'PNG':
112
return wrapped(*args, **kwargs)
113
114
documented_max_png_bytes = 2 * 1024 * 1024
115
- if file_size_bytes > documented_max_png_bytes:
+ if len(image) > documented_max_png_bytes:
116
raise requests.exceptions.ConnectionError
117
118
0 commit comments