Skip to content

Commit 5e4994d

Browse files
authored
Merge pull request #214 from superannotateai/326
326
2 parents 09b4a1d + fb3f55a commit 5e4994d

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3428,6 +3428,8 @@ def upload_image_to_project(
34283428
folder_name=folder_name,
34293429
image_quality_in_editor=image_quality_in_editor,
34303430
)
3431+
if upload_response.errors:
3432+
raise AppException(upload_response.errors)
34313433
controller.upload_images(
34323434
project_name=project_name,
34333435
folder_name=folder_name,

tests/integration/test_image_quality.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import src.superannotate as sa
77
from tests.integration.base import BaseTestCase
8+
from src.superannotate import AppException
89

910

1011
class TestImageQuality(BaseTestCase):
@@ -59,3 +60,23 @@ def test_image_quality_setting2(self):
5960
shallow=False,
6061
)
6162
)
63+
64+
65+
66+
class TestImageQuality(BaseTestCase):
67+
PROJECT_NAME = "pixel image q"
68+
PROJECT_DESCRIPTION = "Desc"
69+
PROJECT_TYPE = "Pixel"
70+
TEST_FOLDER_PATH = "data_set/big_img"
71+
BIG_IMAGE = "big.jpg"
72+
MESSAGE = "Image resolution 44761088 too large. Max supported for resolution is 4000000"
73+
74+
@property
75+
def folder_path(self):
76+
return os.path.join(dirname(dirname(__file__)), self.TEST_FOLDER_PATH)
77+
78+
def test_big_image(self):
79+
try:
80+
sa.upload_image_to_project(self.PROJECT_NAME,f"{self.folder_path}/{self.BIG_IMAGE}")
81+
except AppException as e:
82+
self.assertEqual(str(e),self.MESSAGE)

0 commit comments

Comments
 (0)