Render photos individually, optimize gallery images, and prune old releases
This commit is contained in:
@@ -62,13 +62,18 @@ def test_validation_is_all_or_nothing(service):
|
||||
|
||||
|
||||
def test_multi_megabyte_multipart_file(service):
|
||||
_, client, _ = service
|
||||
_, client, data = service
|
||||
output = io.BytesIO()
|
||||
Image.frombytes("RGB", (1800, 1800), random.Random(2).randbytes(1800 * 1800 * 3)).save(
|
||||
output, "JPEG", quality=95)
|
||||
assert len(output.getvalue()) > 3 * 1024 * 1024
|
||||
response = upload(client, [output.getvalue()])
|
||||
assert response.status_code == 202, response.json
|
||||
path = data / "submissions" / response.json["id"] / "images/00.jpg"
|
||||
assert path.stat().st_size <= 300 * 1024
|
||||
with Image.open(path) as image:
|
||||
assert max(image.size) <= 1600
|
||||
assert image.info.get("progressive")
|
||||
|
||||
|
||||
def test_zip_batch_preserves_all_images_order_and_deduplicates(service):
|
||||
@@ -137,7 +142,7 @@ def test_orientation_metadata_and_heic(service):
|
||||
with Image.open(data / "submissions" / response.json["id"] / "images/00.jpg") as image:
|
||||
assert image.format == "JPEG"
|
||||
assert not image.getexif()
|
||||
assert max(image.size) <= 2560
|
||||
assert max(image.size) <= 1600
|
||||
if raw[:2] == b"\xff\xd8":
|
||||
assert image.height > image.width
|
||||
|
||||
|
||||
Reference in New Issue
Block a user