fix(art): preserve uncropped card art aspect ratio using fit=inside
All checks were successful
ESP32 Build & Release / build (push) Successful in 1m14s
All checks were successful
ESP32 Build & Release / build (push) Successful in 1m14s
This commit is contained in:
@@ -199,6 +199,23 @@ static bool load_art_crop(const char *uid)
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Automatically purge legacy 200x110 cropped art and re-fetch with full uncropped aspect ratio */
|
||||
if (out_info.width == 200 && out_info.height == 110 && wifi_manager_connected()) {
|
||||
ESP_LOGI(TAG, "Purging legacy 200x110 cropped art: %s", jpg_path);
|
||||
free(jpg_buf);
|
||||
remove(jpg_path);
|
||||
if (s_card_name[0] != '\0') {
|
||||
scryfall_fetch_request(s_card_name, uid);
|
||||
} else {
|
||||
char *looked_up_name = NULL;
|
||||
if (storage_manager_lookup_name(uid, &looked_up_name) == ESP_OK && looked_up_name != NULL) {
|
||||
scryfall_fetch_request(looked_up_name, uid);
|
||||
free(looked_up_name);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
if (out_info.width > 240) {
|
||||
cfg.out_scale = (out_info.width > 480) ? JPEG_IMAGE_SCALE_1_4 : JPEG_IMAGE_SCALE_1_2;
|
||||
esp_jpeg_get_image_info(&cfg, &out_info);
|
||||
|
||||
Reference in New Issue
Block a user