File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed
Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -105,14 +105,12 @@ def validate_image_file_size(
105105
106106 [image ] = parsed ['image' ]
107107
108- image_file = io .BytesIO (image )
109- pil_image = Image .open (image_file )
110-
111- if pil_image .format != 'PNG' :
112- return wrapped (* args , ** kwargs )
113-
114- documented_max_png_bytes = 2 * 1024 * 1024
115- if len (image ) > documented_max_png_bytes :
108+ # This is the documented maximum size of a PNG as per.
109+ # https://library.vuforia.com/articles/Solution/How-To-Perform-an-Image-Recognition-Query.
110+ # However, the tests show that this maximum size also applies to JPEG
111+ # files.
112+ max_bytes = 2 * 1024 * 1024
113+ if len (image ) > max_bytes :
116114 raise requests .exceptions .ConnectionError
117115 return wrapped (* args , ** kwargs )
118116
You can’t perform that action at this time.
0 commit comments