fix: avoid rotating Synology display dimensions twice
Community checks / verify (push) Skipped
Verify Frame Flow / verify (push) Successful in 6m41s

This commit is contained in:
渡口浪人
2026-10-18 17:59:02 +08:00
parent f39c7e535b
commit b1c41e91ea
9 changed files with 16 additions and 16 deletions
+1 -1
View File
@@ -30,4 +30,4 @@ CMD ["python", "-m", "uvicorn", "pigway_frame_flow.main:app", "--host", "0.0.0.0
ARG BUILD_COMMIT
ARG BUILD_TIME
ENV BUILD_COMMIT=$BUILD_COMMIT BUILD_TIME=$BUILD_TIME
LABEL org.opencontainers.image.title="PIGWay Frame Flow" org.opencontainers.image.version="0.1.18" org.opencontainers.image.revision=$BUILD_COMMIT
LABEL org.opencontainers.image.title="PIGWay Frame Flow" org.opencontainers.image.version="0.1.19" org.opencontainers.image.revision=$BUILD_COMMIT
+3 -3
View File
@@ -2,7 +2,7 @@
"openapi": "3.1.0",
"info": {
"title": "PIGWay Frame Flow API",
"version": "0.1.18"
"version": "0.1.19"
},
"paths": {
"/api/v1/devices/{device_id}/widgets/selection": {
@@ -15227,7 +15227,7 @@
"version": {
"type": "string",
"title": "Version",
"default": "0.1.18"
"default": "0.1.19"
}
},
"type": "object",
@@ -17490,7 +17490,7 @@
"version": {
"type": "string",
"title": "Version",
"default": "0.1.18"
"default": "0.1.19"
},
"api_version": {
"type": "string",
+2 -2
View File
@@ -126,7 +126,7 @@ def create_app(settings=None, start_worker=True):
app = FastAPI(
title="PIGWay Frame Flow API",
docs_url=None,
version="0.1.18",
version="0.1.19",
lifespan=lifespan,
responses=error_responses,
)
@@ -1040,7 +1040,7 @@ def create_app(settings=None, start_worker=True):
supports_upload=True,
),
],
version="0.1.18",
version="0.1.19",
mock=settings.mock,
write_enabled=settings.write_enabled,
api_key_configured=bool(settings.api_key)
+2 -2
View File
@@ -366,7 +366,7 @@ class SettingsView(BaseModel):
class Health(BaseModel):
status: str
version: str = "0.1.18"
version: str = "0.1.19"
class Readiness(BaseModel):
@@ -397,7 +397,7 @@ class RestoreRequest(StrictModel):
class Version(BaseModel):
product: str = "PIGWay Frame Flow"
version: str = "0.1.18"
version: str = "0.1.19"
api_version: str = "v1"
commit: str = "development"
build_time: str = "unknown"
+1 -3
View File
@@ -481,9 +481,7 @@ class PhotoSources:
continue
size = row.get("additional", {}).get("resolution", {})
width, height = size.get("width", 0), size.get("height", 0)
rotation = row.get("additional", {}).get("orientation", 1)
if rotation in (5, 6, 7, 8):
width, height = height, width
# Photos resolution is already oriented; EXIF must not swap it twice.
if not self.resolution_matches(source, width, height):
continue
direction = orientation(width, height)
+1 -1
View File
@@ -1,3 +1,3 @@
<!doctype html>
<html lang="zh-CN"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover"><meta name="color-scheme" content="light dark"><title>PIGWay Frame Flow</title><link rel="stylesheet" href="/ui/style.css"></head>
<body><aside class="sidebar"><a class="brand" href="/"><span>PIGWay Frame Flow<small>Smart Frame Automation</small></span></a><nav id="nav"></nav><div class="sidebar-bottom"><small>Version 0.1.18</small></div></aside><div class="workspace"><header><div><span class="eyebrow">PIGWay Frame Flow</span><h1 id="page-title"></h1></div><div class="toolbar"><select id="device" aria-label="Device"></select><button id="lang" class="icon-button" aria-label="Change language">EN</button><button id="theme" class="icon-button" aria-label="Change theme">◐</button></div></header><main id="main"></main><footer id="footer"></footer></div><div id="toast" role="status" aria-live="polite"></div><dialog id="modal"><div id="modal-content"></div></dialog><script src="/ui/i18n.js?v=photo-quality-v0117"></script><script src="/ui/features.js?v=photo-quality-v0117"></script><script src="/ui/extensions.js?v=photo-quality-v0117"></script><script src="/ui/app.js?v=photo-quality-v0117"></script></body></html>
<body><aside class="sidebar"><a class="brand" href="/"><span>PIGWay Frame Flow<small>Smart Frame Automation</small></span></a><nav id="nav"></nav><div class="sidebar-bottom"><small>Version 0.1.19</small></div></aside><div class="workspace"><header><div><span class="eyebrow">PIGWay Frame Flow</span><h1 id="page-title"></h1></div><div class="toolbar"><select id="device" aria-label="Device"></select><button id="lang" class="icon-button" aria-label="Change language">EN</button><button id="theme" class="icon-button" aria-label="Change theme">◐</button></div></header><main id="main"></main><footer id="footer"></footer></div><div id="toast" role="status" aria-live="polite"></div><dialog id="modal"><div id="modal-content"></div></dialog><script src="/ui/i18n.js?v=photo-quality-v0117"></script><script src="/ui/features.js?v=photo-quality-v0117"></script><script src="/ui/extensions.js?v=photo-quality-v0117"></script><script src="/ui/app.js?v=photo-quality-v0117"></script></body></html>
+1 -1
View File
@@ -1,6 +1,6 @@
[project]
name = "pigway-frame-flow"
version = "0.1.18"
version = "0.1.19"
requires-python = ">=3.14,<3.15"
dependencies = ["paho-mqtt==2.1.0", "python-dateutil==2.9.0.post0", "fastapi==0.142.2", "uvicorn==0.54.0", "pillow==12.3.0", "requests==2.34.2", "croniter==6.2.4", "python-multipart==0.0.32", "pyyaml==6.0.3"]
[project.optional-dependencies]
+1 -1
View File
@@ -155,7 +155,7 @@ def release(lock):
assert dst.execute("pragma quick_check").fetchone()[0] == "ok"
base = "pigway-frame-flow:release-base-" + commit[:12]
run("docker", "image", "tag", before["Image"], base)
image = "pigway-frame-flow:0.1.18-" + commit[:12]
image = "pigway-frame-flow:0.1.19-" + commit[:12]
try:
run(
"docker",
+4 -2
View File
@@ -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",