fix: avoid rotating Synology display dimensions twice
This commit is contained in:
@@ -405,7 +405,7 @@ def test_explicit_offline_conversion_preserves_task_reference(service, settings)
|
||||
|
||||
@pytest.mark.parametrize("space", ["shared", "personal"])
|
||||
@pytest.mark.parametrize("exif", [5, 6, 7, 8])
|
||||
def test_api_requests_orientation_before_filtering_rotated_portraits(
|
||||
def test_api_filters_already_oriented_resolution_without_rotating_twice(
|
||||
service, settings, monkeypatch, space, exif
|
||||
):
|
||||
session(settings)
|
||||
@@ -415,7 +415,8 @@ def test_api_requests_orientation_before_filtering_rotated_portraits(
|
||||
def pages(api, version, **params):
|
||||
requested[:] = json.loads(params["additional"])
|
||||
item = row(1)
|
||||
# Model Photos' opt-in fields: stored pixels alone look landscape.
|
||||
# Photos returns display dimensions even when EXIF retains a rotation.
|
||||
item["additional"]["resolution"] = {"width": 16, "height": 24}
|
||||
if "orientation" in requested:
|
||||
item["additional"]["orientation"] = exif
|
||||
return [item]
|
||||
@@ -469,6 +470,7 @@ def test_fetched_photo_direction_is_checked_before_cropping(
|
||||
# A correctly selected portrait remains readable, including EXIF-only rotation.
|
||||
item = row(1)
|
||||
item["additional"]["orientation"] = 8
|
||||
item["additional"]["resolution"] = {"width": 16, "height": 24}
|
||||
monkeypatch.setattr(photos.synology, "items", lambda *a, **k: [item])
|
||||
photos.save(
|
||||
"direction",
|
||||
|
||||
Reference in New Issue
Block a user