Skip to content

Commit da45e3f

Browse files
committed
Fixing extra dim in array4thumbnail
1 parent 11f0ed4 commit da45e3f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/psup_stac_converter/utils/file_utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,12 +151,13 @@ def convert_arr_to_thumbnail(
151151
result = cm(result)[..., :4] # includes alpha
152152
result = (result * 255).astype(np.uint8)
153153
if mode == "RGB":
154-
result = result[..., :3][0]
154+
result = result[..., :3]
155155
else:
156156
result = (result * 255).astype(np.uint8)
157157
if mode in ["RGB", "RGBA"]:
158158
result = np.stack([result] * (3 if mode == "RGB" else 4), axis=-1)
159159

160+
result = np.squeeze(result)
160161
img = Image.fromarray(result, mode=mode)
161162
img = img.resize(resize_dims, Image.Resampling.LANCZOS)
162163

0 commit comments

Comments
 (0)