Skip to content

Commit 121296f

Browse files
committed
Fix 324
1 parent 2027bfc commit 121296f

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/superannotate/lib/app/interface/sdk_interface.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3412,7 +3412,9 @@ def upload_image_to_project(
34123412

34133413
if not isinstance(img, io.BytesIO):
34143414
if from_s3_bucket:
3415-
image_bytes = controller.get_image_from_s3(from_s3_bucket, image_name)
3415+
response = controller.get_image_from_s3(from_s3_bucket, img)
3416+
image_bytes = response.data
3417+
34163418
else:
34173419
image_bytes = io.BytesIO(open(img, "rb").read())
34183420
else:

tests/integration/test_interface.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ class TestInterface(BaseTestCase):
1717
TEST_FOLDER_NAME = "folder"
1818
EXAMPLE_IMAGE_1 = "example_image_1.jpg"
1919
EXAMPLE_IMAGE_2 = "example_image_2.jpg"
20+
NEW_IMAGE_NAME = "new_name_yup"
21+
IMAGE_PATH_IN_S3 = 'MP.MB/img1.bmp'
22+
TEST_S3_BUCKET_NAME = "test-openseadragon-1212"
2023

2124
@property
2225
def data_set_path(self):
@@ -159,6 +162,11 @@ def test_upload_images_to_project_image_quality_in_editor(self):
159162
image_quality_in_editor='random_string'
160163
)
161164

165+
def test_image_upload_with_set_name_on_platform(self):
166+
sa.upload_image_to_project(self.PROJECT_NAME, self.IMAGE_PATH_IN_S3 , self.NEW_IMAGE_NAME,from_s3_bucket=self.TEST_S3_BUCKET_NAME)
167+
self.assertIn(sa.search_images(self.PROJECT_NAME)[0],self.NEW_IMAGE_NAME)
168+
169+
162170

163171
class TestPixelInterface(BaseTestCase):
164172
PROJECT_NAME = "Interface test"

0 commit comments

Comments
 (0)