diff options
| author | Eli Zaretskii | 2024-06-01 16:43:18 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2024-06-01 16:43:18 +0300 |
| commit | d2dce513445d7235c9f751ea6d9b4847d62882e7 (patch) | |
| tree | 7f3aa5fcd3be7ca24f44c96f85ea8c1ab1ad41f4 /src | |
| parent | 7af5d6fc9a352d4f53f8e48a6bc9ae9a3bf235a3 (diff) | |
| download | emacs-d2dce513445d7235c9f751ea6d9b4847d62882e7.tar.gz emacs-d2dce513445d7235c9f751ea6d9b4847d62882e7.zip | |
Fix misc problems with thumbnails on MS-Windows
* lisp/image/image-dired-external.el (image-dired-pngcrush-thumb):
Fix deletion of intermediate file.
(image-dired-cmd-pngcrush-options)
(image-dired-cmd-create-standard-thumbnail-options): Use %u for
file:// URI.
(image-dired--file-URI): New function.
(image-dired-create-thumb-1, image-dired-create-thumb-2)
(image-dired-set-exif-data): Use it to generate correct URI on
MS-Windows.
* src/w32image.c (Fw32image_create_thumbnail): Copy the file names
before mirroring their slashes.
Diffstat (limited to 'src')
| -rw-r--r-- | src/w32image.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/w32image.c b/src/w32image.c index 6daf42c1916..e71471f4a7c 100644 --- a/src/w32image.c +++ b/src/w32image.c | |||
| @@ -631,7 +631,8 @@ Return non-nil if thumbnail creation succeeds, nil otherwise. */) | |||
| 631 | 631 | ||
| 632 | /* Create an image by reading from INPUT_FILE. */ | 632 | /* Create an image by reading from INPUT_FILE. */ |
| 633 | wchar_t input_file_w[MAX_PATH]; | 633 | wchar_t input_file_w[MAX_PATH]; |
| 634 | input_file = ENCODE_FILE (Fexpand_file_name (input_file, Qnil)); | 634 | input_file |
| 635 | = ENCODE_FILE (Fexpand_file_name (Fcopy_sequence (input_file), Qnil)); | ||
| 635 | unixtodos_filename (SSDATA (input_file)); | 636 | unixtodos_filename (SSDATA (input_file)); |
| 636 | filename_to_utf16 (SSDATA (input_file), input_file_w); | 637 | filename_to_utf16 (SSDATA (input_file), input_file_w); |
| 637 | GpImage *file_image; | 638 | GpImage *file_image; |
| @@ -652,7 +653,9 @@ Return non-nil if thumbnail creation succeeds, nil otherwise. */) | |||
| 652 | { | 653 | { |
| 653 | /* Save the thumbnail image to a file of specified TYPE. */ | 654 | /* Save the thumbnail image to a file of specified TYPE. */ |
| 654 | wchar_t thumb_file_w[MAX_PATH]; | 655 | wchar_t thumb_file_w[MAX_PATH]; |
| 655 | thumb_file = ENCODE_FILE (Fexpand_file_name (thumb_file, Qnil)); | 656 | thumb_file |
| 657 | = ENCODE_FILE (Fexpand_file_name (Fcopy_sequence (thumb_file), | ||
| 658 | Qnil)); | ||
| 656 | unixtodos_filename (SSDATA (thumb_file)); | 659 | unixtodos_filename (SSDATA (thumb_file)); |
| 657 | filename_to_utf16 (SSDATA (thumb_file), thumb_file_w); | 660 | filename_to_utf16 (SSDATA (thumb_file), thumb_file_w); |
| 658 | status = GdipSaveImageToFile (thumb_image, thumb_file_w, | 661 | status = GdipSaveImageToFile (thumb_image, thumb_file_w, |