summaryrefslogtreecommitdiff
path: root/src/thumbnail.c
diff options
context:
space:
mode:
authorDennis Real <github@tildepipe.org>2012-11-11 21:26:42 +0100
committerDennis Real <github@tildepipe.org>2012-11-11 21:26:42 +0100
commita3d28a957f8b4a24cbc102a8dca77bb78b568ab4 (patch)
tree4025736270638f5035e28541b7edee40ef6700bb /src/thumbnail.c
parent0f6d9518b5a12538e4064ef1c397b62e6be61f3b (diff)
parent96d57781be7171d29c7ea0ecbbddc48ad374885c (diff)
Merge branch 'master' of git://github.com/derf/feh
Diffstat (limited to 'src/thumbnail.c')
-rw-r--r--src/thumbnail.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/thumbnail.c b/src/thumbnail.c
index b26dc7f..fbe2ce0 100644
--- a/src/thumbnail.c
+++ b/src/thumbnail.c
@@ -55,6 +55,7 @@ void init_thumbnail_mode(void)
int max_column_w = 0;
*/
+ Imlib_Load_Error err;
Imlib_Image im_temp;
int ww = 0, hh = 0, www, hhh, xxx, yyy;
int orig_w, orig_h;
@@ -381,8 +382,11 @@ void init_thumbnail_mode(void)
snprintf(output_buf, 1024, "%s/%s", opt.output_dir, opt.output_file);
else
strncpy(output_buf, opt.output_file, 1024);
- gib_imlib_save_image(td.im_main, output_buf);
- if (opt.verbose) {
+ ungib_imlib_save_image_with_error_return(td.im_main, output_buf, &err);
+ if (err) {
+ feh_imlib_print_load_error(output_buf, td.im_main, err);
+ }
+ else if (opt.verbose) {
int tw, th;
tw = gib_imlib_image_get_width(td.im_main);
@@ -596,6 +600,9 @@ char *feh_thumbnail_get_name_uri(char *name)
/* FIXME: add support for ~, need to investigate if it's expanded
somewhere else before adding (unecessary) code */
if (name[0] != '/') {
+ /* work around /some/path/./image.ext */
+ if ((strncmp(name, "./", 2)) == 0)
+ name += 2;
cwd = getcwd(NULL, 0);
uri = estrjoin("/", "file:/", cwd, name, NULL);
free(cwd);