[artwork] Add ability to request a specific image format

This commit is contained in:
ejurgensen
2020-11-05 23:06:23 +01:00
parent 7e106aec09
commit 2098349fdb
2 changed files with 91 additions and 61 deletions

View File

@@ -4,6 +4,7 @@
#define ART_FMT_PNG 1
#define ART_FMT_JPEG 2
#define ART_FMT_VP8 3
#define ART_DEFAULT_HEIGHT 600
#define ART_DEFAULT_WIDTH 600
@@ -18,10 +19,13 @@
* @in id The mfi item id
* @in max_w Requested maximum image width (may not be obeyed)
* @in max_h Requested maximum image height (may not be obeyed)
* @in format Requested format (may not be obeyed)
* @return ART_FMT_* on success, -1 on error or no artwork found
*/
int
artwork_get_item(struct evbuffer *evbuf, int id, int max_w, int max_h);
int
artwork_get_item2(struct evbuffer *evbuf, int id, int max_w, int max_h, int format);
/*
* Get the artwork image for a group (an album or an artist)
@@ -30,10 +34,13 @@ artwork_get_item(struct evbuffer *evbuf, int id, int max_w, int max_h);
* @in id The group id (not the persistentid)
* @in max_w Requested maximum image width (may not be obeyed)
* @in max_h Requested maximum image height (may not be obeyed)
* @in format Requested format (may not be obeyed)
* @return ART_FMT_* on success, -1 on error or no artwork found
*/
int
artwork_get_group(struct evbuffer *evbuf, int id, int max_w, int max_h);
int
artwork_get_group2(struct evbuffer *evbuf, int id, int max_w, int max_h, int format);
/*
* Checks if the file is an artwork file (based on user config)