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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user