diff options
author | 2011-02-26 21:28:14 +0100 | |
---|---|---|
committer | 2011-02-26 21:28:14 +0100 | |
commit | ad384162bb0cbe366c91a1f1bf30c61a79a815d5 (patch) | |
tree | 687cfb5e66647140e3fc1a1421c9a533279a4ede /plugins/artwork | |
parent | 37a9075dd3de76f3e7d145b89de3eeafdffbbd8b (diff) |
artwork: added option to proportionally scale towards bigger side of an image
notify: customizable icon/artwork size
Diffstat (limited to 'plugins/artwork')
-rw-r--r-- | plugins/artwork/artwork.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/plugins/artwork/artwork.c b/plugins/artwork/artwork.c index 713ba76e..aadd6a98 100644 --- a/plugins/artwork/artwork.c +++ b/plugins/artwork/artwork.c @@ -189,13 +189,25 @@ copy_file (const char *in, const char *out, int img_size) { int w = imlib_image_get_width (); int h = imlib_image_get_height (); int sw, sh; - if (w < h) { - sh = img_size; - sw = img_size * w / h; + if (deadbeef->conf_get_int ("artwork.scale_towards_longer", 1)) { + if (w > h) { + sh = img_size; + sw = img_size * w / h; + } + else { + sw = img_size; + sh = img_size * h / w; + } } else { - sw = img_size; - sh = img_size * h / w; + if (w < h) { + sh = img_size; + sw = img_size * w / h; + } + else { + sw = img_size; + sh = img_size * h / w; + } } Imlib_Image scaled = imlib_create_image (sw, sh); imlib_context_set_image (scaled); @@ -799,6 +811,7 @@ static const char settings_dlg[] = "property \"Local cover file mask\" entry artwork.filemask \"" DEFAULT_FILEMASK "\";\n" "property \"Fetch from last.fm\" checkbox artwork.enable_lastfm 0;\n" "property \"Fetch from albumart.org\" checkbox artwork.enable_albumartorg 0;\n" + "property \"Scale artwork towards longer side\" checkbox artwork.scale_towards_longer 1;\n" ; // define plugin interface |