* Always store cached JPEG album art with a .jpg extension.

This commit is contained in:
Justin Maggard 2009-05-11 00:56:04 +00:00
parent 161c513e58
commit cb61823ecc
2 changed files with 15 additions and 3 deletions

View File

@ -33,6 +33,17 @@
#include "image_utils.h"
#include "log.h"
char *
art_cache_path(const char * orig_path)
{
char * cache_file;
asprintf(&cache_file, DB_PATH "/art_cache%s", orig_path);
strcpy(strchr(cache_file, '\0')-4, ".jpg");
return cache_file;
}
char *
save_resized_album_art(image * imsrc, const char * path)
{
@ -44,7 +55,7 @@ save_resized_album_art(image * imsrc, const char * path)
if( !imsrc )
return NULL;
asprintf(&cache_file, DB_PATH "/art_cache%s", path);
cache_file = art_cache_path(path);
if( access(cache_file, F_OK) == 0 )
return cache_file;
@ -116,7 +127,7 @@ check_embedded_art(const char * path, const char * image_data, int image_size)
{
if( !last_success )
return NULL;
asprintf(&art_path, DB_PATH "/art_cache%s", path);
art_path = art_cache_path(path);
if( link(last_path, art_path) == 0 )
{
return(art_path);
@ -153,7 +164,7 @@ check_embedded_art(const char * path, const char * image_data, int image_size)
}
else if( width > 0 && height > 0 )
{
asprintf(&art_path, DB_PATH "/art_cache%s", path);
art_path = art_cache_path(path);
if( access(art_path, F_OK) == 0 )
goto end_art;
cache_dir = strdup(art_path);

View File

@ -119,6 +119,7 @@ GetProtocolInfo(struct upnphttp * h, const char * action)
action, "urn:schemas-upnp-org:service:ConnectionManager:1",
action);
BuildSendAndCloseSoapResp(h, body, bodylen);
free(body);
}
static void