@@ -135,63 +135,56 @@ def create_save_image_sizes(image_file, image_sizes_type, unique_identifier=None
135
135
if unique_identifier is None :
136
136
unique_identifier = get_file_name ()
137
137
138
- large_aspect = image_sizes .full_aspect if image_sizes .full_aspect else True
139
- large_basewidth = image_sizes .full_width if image_sizes .full_width else 1300
140
- large_height_size = image_sizes .full_height if image_sizes .full_width else 500
141
-
142
138
if image_sizes_type == 'speaker-image' :
143
- thumbnail_aspect = image_sizes . thumbnail_aspect if image_sizes . thumbnail_aspect else True
139
+ thumbnail_aspect = icon_aspect = small_aspect = True
144
140
thumbnail_basewidth = thumbnail_height_size = image_sizes .thumbnail_size_width_height
145
- else :
146
- thumbnail_aspect = image_sizes .thumbnail_aspect
147
- thumbnail_basewidth = image_sizes .thumbnail_width
148
- thumbnail_height_size = image_sizes .thumbnail_height
149
-
150
- if image_sizes_type == 'speaker-image' :
151
- icon_aspect = image_sizes .icon_aspect if image_sizes .icon_aspect else True
152
141
icon_basewidth = icon_height_size = image_sizes .icon_size_width_height
153
- else :
154
- icon_aspect = image_sizes .icon_aspect
155
- icon_basewidth = image_sizes .icon_width
156
- icon_height_size = image_sizes .icon_height
157
-
158
- if image_sizes_type == 'event-image' :
159
- original_upload_path = UPLOAD_PATHS ['event' ]['original' ].format (
160
- identifier = unique_identifier )
161
- large_upload_path = UPLOAD_PATHS ['event' ]['large' ].format (
162
- identifier = unique_identifier )
163
- thumbnail_upload_path = UPLOAD_PATHS ['event' ]['thumbnail' ].format (
164
- identifier = unique_identifier )
165
- icon_upload_path = UPLOAD_PATHS ['event' ]['icon' ].format (
166
- identifier = unique_identifier )
167
- elif image_sizes_type == 'speaker-image' :
142
+ small_basewidth = small_height_size = image_sizes .small_size_width_height
168
143
original_upload_path = UPLOAD_PATHS ['user' ]['original' ].format (
169
144
identifier = unique_identifier )
170
- large_upload_path = UPLOAD_PATHS ['user' ]['large ' ].format (
145
+ small_upload_path = UPLOAD_PATHS ['user' ]['small ' ].format (
171
146
identifier = unique_identifier )
172
147
thumbnail_upload_path = UPLOAD_PATHS ['user' ]['thumbnail' ].format (
173
148
identifier = unique_identifier )
174
149
icon_upload_path = UPLOAD_PATHS ['user' ]['icon' ].format (
175
150
identifier = unique_identifier )
151
+ new_images = {
152
+ 'original_image_url' : create_save_resized_image (image_file , 0 , 0 , 0 , original_upload_path , resize = False ),
153
+ 'small_image_url' : create_save_resized_image (image_file , small_basewidth , small_aspect , small_height_size ,
154
+ small_upload_path ),
155
+ 'thumbnail_image_url' : create_save_resized_image (image_file , thumbnail_basewidth , thumbnail_aspect ,
156
+ thumbnail_height_size , thumbnail_upload_path ),
157
+ 'icon_image_url' : create_save_resized_image (image_file , icon_basewidth , icon_aspect , icon_height_size ,
158
+ icon_upload_path )
159
+ }
160
+
176
161
else :
177
- original_upload_path = UPLOAD_PATHS [image_sizes_type ]['original' ].format (
162
+ large_aspect = image_sizes .full_aspect if image_sizes .full_aspect else False
163
+ large_basewidth = image_sizes .full_width if image_sizes .full_width else 1300
164
+ large_height_size = image_sizes .full_height if image_sizes .full_width else 500
165
+ thumbnail_aspect = image_sizes .thumbnail_aspect if image_sizes .full_aspect else False
166
+ thumbnail_basewidth = image_sizes .thumbnail_width if image_sizes .thumbnail_width else 500
167
+ thumbnail_height_size = image_sizes .thumbnail_height if image_sizes .thumbnail_height else 200
168
+ icon_aspect = image_sizes .icon_aspect if image_sizes .icon_aspect else False
169
+ icon_basewidth = image_sizes .icon_width if image_sizes .icon_width else 75
170
+ icon_height_size = image_sizes .icon_height if image_sizes .icon_height else 30
171
+ original_upload_path = UPLOAD_PATHS ['event' ]['original' ].format (
178
172
identifier = unique_identifier )
179
- large_upload_path = UPLOAD_PATHS [image_sizes_type ]['large' ].format (
173
+ large_upload_path = UPLOAD_PATHS ['event' ]['large' ].format (
180
174
identifier = unique_identifier )
181
- thumbnail_upload_path = UPLOAD_PATHS [image_sizes_type ]['thumbnail' ].format (
175
+ thumbnail_upload_path = UPLOAD_PATHS ['event' ]['thumbnail' ].format (
182
176
identifier = unique_identifier )
183
- icon_upload_path = UPLOAD_PATHS [image_sizes_type ]['icon' ].format (
177
+ icon_upload_path = UPLOAD_PATHS ['event' ]['icon' ].format (
184
178
identifier = unique_identifier )
185
-
186
- new_images = {
187
- 'original_image_url' : create_save_resized_image (image_file , 0 , 0 , 0 , original_upload_path , resize = False ),
188
- 'large_image_url' : create_save_resized_image (image_file , large_basewidth , large_aspect , large_height_size ,
189
- large_upload_path ),
190
- 'thumbnail_image_url' : create_save_resized_image (image_file , thumbnail_basewidth , thumbnail_aspect ,
191
- thumbnail_height_size , thumbnail_upload_path ),
192
- 'icon_image_url' : create_save_resized_image (image_file , icon_basewidth , icon_aspect , icon_height_size ,
193
- icon_upload_path )
194
- }
179
+ new_images = {
180
+ 'original_image_url' : create_save_resized_image (image_file , 0 , 0 , 0 , original_upload_path , resize = False ),
181
+ 'large_image_url' : create_save_resized_image (image_file , large_basewidth , large_aspect , large_height_size ,
182
+ large_upload_path ),
183
+ 'thumbnail_image_url' : create_save_resized_image (image_file , thumbnail_basewidth , thumbnail_aspect ,
184
+ thumbnail_height_size , thumbnail_upload_path ),
185
+ 'icon_image_url' : create_save_resized_image (image_file , icon_basewidth , icon_aspect , icon_height_size ,
186
+ icon_upload_path )
187
+ }
195
188
196
189
return new_images
197
190
0 commit comments