]> git.eshelyaron.com Git - emacs.git/commitdiff
Use floor of mtime instead of rounding for thumb property
authorMark Oteiza <mvoteiza@udel.edu>
Sun, 18 Dec 2016 12:28:03 +0000 (07:28 -0500)
committerMark Oteiza <mvoteiza@udel.edu>
Sun, 18 Dec 2016 12:28:03 +0000 (07:28 -0500)
This seems to be the correct thing to do, at least more in line with
what at least one other implementation does.  Anything using
gnome-desktop [0] effectively does the same, as
gnome_desktop_thumbnail_is_valid applies atol(3) to mtime for
comparison and time_t on GNU/Linux is a signed int.
[0] https://git.gnome.org/browse/gnome-desktop/
* lisp/image-dired.el (image-dired-create-thumb): Use floor here.

lisp/image-dired.el

index 96570a503f82e9a9a8a49fc29b8ab04836e83ad6..dd0c5b512e7b0ac6fa1a1d825d134d9f68255946 100644 (file)
@@ -646,8 +646,7 @@ DIMENSION should be either the symbol 'width or 'height."
    'image-dired-cmd-create-thumbnail-program)
   (let* ((width (int-to-string (image-dired-thumb-size 'width)))
          (height (int-to-string (image-dired-thumb-size 'height)))
-         (modif-time (format "%.0f" (float-time (nth 5 (file-attributes
-                                                        original-file)))))
+         (modif-time (floor (float-time (nth 5 (file-attributes original-file)))))
          (thumbnail-nq8-file (replace-regexp-in-string ".png\\'" "-nq8.png"
                                                        thumbnail-file))
          (command