rommapp / romm

A beautiful, powerful, self-hosted rom manager
https://romm.app
GNU Affero General Public License v3.0
2.37k stars 96 forks source link

fix: Download IGDB screenshots with right aspect ratio #1263

Closed adamantike closed 3 weeks ago

adamantike commented 3 weeks ago

The IGDB API provides screenshots in 720p resolution, when either screenshot_huge or 720p size values are used [1]. The screenshot_huge uses Lfill, while 720p uses Fit as the resizing method.

That means that either screenshot_huge or 720p will provide the correct aspect ratio for 16:9 platforms. However, for platforms with a different aspect ratio, we need to use the 720p size value to get the correct image instead of a cropped one.

Example:

[1] https://api-docs.igdb.com/#images

github-actions[bot] commented 3 weeks ago

Test Results

88 tests  ±0   88 ✅ ±0   26s ⏱️ ±0s  1 suites ±0    0 💤 ±0   1 files   ±0    0 ❌ ±0 

Results for commit 75209645. ± Comparison against base commit 373757e3.