Viewer: save to Vita, turn with L/R; album name order, cover shape setting

- Inside an album, SELECT cycles newest / oldest / file name A-Z / Z-A
  (natural, case-insensitive; name orders drop the month headers and
  L/R jump by initial letter). Asset originalFileName is now parsed.
- Full-screen viewer: Triangle or the "Save to Vita" button downloads
  the original (falling back to Immich's full-size / preview JPEG) and
  exports it to the Photos app via ScePhotoExport (new src/export.c).
  The video downloader is now a generic download_to_file().
- R / L turn the whole viewer 90 degrees clockwise / counter-clockwise
  so the Vita can be held upright (new src/viewrot.c): it renders into
  a portrait render target drawn rotated, and maps d-pad, sticks and
  touch into the turned screen. Zoom moves to the right stick only.
  SCREEN_W/H are now variables for that logical screen.
- Server & Backup page: album cover shape setting (vertical 3:4,
  square, panoramic 16:9), saved as covershape= in config.txt.
- Test builds: "rup" holds the right stick up in test_input.txt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
nino
2026-10-24 13:08:11 -06:00
co-authored by Claude Opus 5.5
parent c296ff5ade
commit 64a240b082
14 changed files with 698 additions and 55 deletions
+9 -2
View File
@@ -42,6 +42,7 @@
#include <psp2/net/netctl.h>
#include <psp2/sysmodule.h>
#include <psp2/ime_dialog.h>
#include <psp2/photoexport.h>
#include <psp2/common_dialog.h>
#include <vita2d.h>
@@ -54,8 +55,11 @@
#define JSMN_PARENT_LINKS
#include "jsmn.h"
#define SCREEN_W 960
#define SCREEN_H 544
/* the logical screen the UI lays itself out in: 960x544, except while the
* rotated photo viewer draws into its portrait render target (544x960) */
static int g_screen_w = 960, g_screen_h = 544;
#define SCREEN_W g_screen_w
#define SCREEN_H g_screen_h
#define COLS 5 /* rough items per row, for prefetch distances only */
#define ROW_H 200 /* justified-grid row height; widths follow aspect */
@@ -124,6 +128,7 @@ static vita2d_texture *g_ic_both;
* buffers), so a realloc here can't dangle a pointer under it. */
static char (*g_asset_ids)[40];
static char (*g_asset_dates)[DATELEN]; /* YYYY-MM-DDTHH:MM:SS */
static char (*g_asset_names)[64]; /* originalFileName, "" = unknown */
static float *g_asset_ratio; /* display w/h from exif, 0 = unknown */
static unsigned char *g_asset_rot; /* raw exif orientation (0 = none) */
static unsigned char *g_asset_is_video;
@@ -162,5 +167,7 @@ static char (*g_tex_err)[160];
#include "map.c" /* geotag map: markers, clustering, projection */
#include "albums.c" /* album list page + album open/fetch threads */
#include "video.c" /* video download + SceAvPlayer playback */
#include "export.c" /* save a photo to the Vita's Photos app */
#include "viewrot.c" /* L/R-turned photo viewer (render target) */
#include "sync.c" /* local scan/hash/check/upload + sync overview */
#include "app.c" /* main(): init, event loop, threads */