aboutsummaryrefslogtreecommitdiffstats
path: root/src/w32image.c
diff options
context:
space:
mode:
authorEli Zaretskii2020-04-25 16:37:46 +0300
committerEli Zaretskii2020-04-25 16:37:46 +0300
commitf7748ad682abca5968ce24ed488ba56d2e48ef8a (patch)
treee5528510637c6d88e0004d66c1120f088620c013 /src/w32image.c
parent2a3a0a843f66db6f693e084b2fbd40eeda70afbc (diff)
downloademacs-f7748ad682abca5968ce24ed488ba56d2e48ef8a.tar.gz
emacs-f7748ad682abca5968ce24ed488ba56d2e48ef8a.zip
Fix GDI+ image loading by file name
Without a call to image_find_image, we can get a file name that is relative to data-directory/images/, or a file name that starts with "~/", in which case w32_load_image would fail. * src/image.c (native_image_load): Call image_find_image_file to resolve and encode the image file name. * src/w32image.c (w32_load_image): No need to encode the file name, as it's already encoded by native_image_load.
Diffstat (limited to 'src/w32image.c')
-rw-r--r--src/w32image.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/src/w32image.c b/src/w32image.c
index 8d39a09dc7e..70b2eb29b87 100644
--- a/src/w32image.c
+++ b/src/w32image.c
@@ -414,7 +414,6 @@ w32_load_image (struct frame *f, struct image *img,
414 and succeeded. We have a valid token and GDI+ is active. */ 414 and succeeded. We have a valid token and GDI+ is active. */
415 if (STRINGP (spec_file)) 415 if (STRINGP (spec_file))
416 { 416 {
417 spec_file = ENCODE_FILE (spec_file);
418 const char *fn = map_w32_filename (SSDATA (spec_file), NULL); 417 const char *fn = map_w32_filename (SSDATA (spec_file), NULL);
419 wchar_t filename_w[MAX_PATH]; 418 wchar_t filename_w[MAX_PATH];
420 filename_to_utf16 (fn, filename_w); 419 filename_to_utf16 (fn, filename_w);