summaryrefslogtreecommitdiff
path: root/lisp/image-dired.el
diff options
context:
space:
mode:
authorMark Oteiza <mvoteiza@udel.edu>2016-12-18 07:28:03 -0500
committerMark Oteiza <mvoteiza@udel.edu>2016-12-18 07:28:03 -0500
commitb21a3e726feb521d013d3bda6dd8fd8e0c78ad37 (patch)
treea8dd8353ac13451eb1db9c3d5cff6a0106f0cbc8 /lisp/image-dired.el
parent1a15d14e143ed84d8116c6510f9619d936ea43a1 (diff)
downloademacs-b21a3e726feb521d013d3bda6dd8fd8e0c78ad37.tar.gz
Use floor of mtime instead of rounding for thumb property
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.
Diffstat (limited to 'lisp/image-dired.el')
-rw-r--r--lisp/image-dired.el3
1 files changed, 1 insertions, 2 deletions
diff --git a/lisp/image-dired.el b/lisp/image-dired.el
index 96570a503f8..dd0c5b512e7 100644
--- a/lisp/image-dired.el
+++ b/lisp/image-dired.el
@@ -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