fix: rotate portrait renders to EPD-native byte layout
CI / test (push) Has been cancelled

The .bin file for portrait orientation was packed as 480-pixel rows ×
800 rows, but firmware streams blindly at 800×480 (the EPD's native
scan order). Both layouts hit the same 192000-byte total, so the size
guard in epd_draw_image_with_border passed and the row-stride mismatch
showed up on the panel as the photo tiling/repeating.

Renderer now rotates the cropped photo 90° CW before dithering when
orientation is portrait, so the packed bytes always match the EPD's
800-pixel scan order. Firmware stays orientation-unaware (per the
"ESP32 never transforms images" decision in webApp/CLAUDE.md). Preview
decoder rotates -90° on the way out so the in-browser frame preview
stays upright.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-06 14:06:41 -04:00
parent c2b208f103
commit 70d48f9b11
3 changed files with 36 additions and 5 deletions
+12
View File
@@ -17,4 +17,16 @@ enum DeviceModel: string
{
return $orientation === Orientation::Portrait ? 800 : 480;
}
/** EPD's hardware scan-row width — independent of user orientation. */
public function nativeWidth(): int
{
return 800;
}
/** EPD's hardware scan-row count — independent of user orientation. */
public function nativeHeight(): int
{
return 480;
}
}