GNU bug report logs - #53229
29.0.50; Image-dired is not reusing thumbnails created in emacs-27

Previous Next

Package: emacs;

Reported by: Thierry Volpiatto <thievol <at> posteo.net>

Date: Thu, 13 Jan 2022 13:45:02 UTC

Severity: minor

Found in version 29.0.50

Done: Stefan Kangas <stefan <at> marxist.se>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 53229 in the body.
You can then email your comments to 53229 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#53229; Package emacs. (Thu, 13 Jan 2022 13:45:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Thierry Volpiatto <thievol <at> posteo.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 13 Jan 2022 13:45:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Thierry Volpiatto <thievol <at> posteo.net>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.0.50; Image-dired is not reusing thumbnails created in emacs-27
Date: Thu, 13 Jan 2022 13:41:01 +0000
Hello, 

the title says all, emacs-29 is creating new thumbnails instead of
reusing existing ones:

;; Emacs-27
(image-dired-get-thumbnail-image "~/Images/Astroman-2009-05-13/astroman-nath-100.jpg")
=>(image :type jpeg :file "/home/thierry/.emacs.d/image-dired/astroman-nath-100_3543f3094906282113616dab5f911376.thumb.jpg" :scale 1.0021052631578946)

;; Emacs-29
(image-dired-get-thumbnail-image "~/Images/Astroman-2009-05-13/astroman-nath-100.jpg")
=>(image :type jpeg :file "/home/thierry/.emacs.d/image-dired/astroman-nath-100_086271a8c0fa94a028dcc0407c24d954480afdfb.thumb.jpg" :scale 1.0021052631578946 :transform-smoothing t)



In GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.20, cairo version 1.16.0)
 of 2022-01-13 built on IPad-S340
Repository revision: 626c1dce02d4f2e8d0822decf8b421eee00674b1
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12013000
System Description: Linux Mint 20.2

Configured using:
 'configure CFLAGS=-O8 --with-mailutils --with-cairo
 --with-native-compilation'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES
NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3
THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE XIM XPM GTK3 ZLIB

Important settings:
  value of $LANG: fr_FR.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Ilisp

Minor modes in effect:
  global-undo-tree-mode: t
  undo-tree-mode: t
  psession-mode: t
  psession-savehist-mode: t
  global-git-gutter-mode: t
  display-time-mode: t
  winner-mode: t
  helm-epa-mode: t
  helm-descbinds-mode: t
  helm-adaptive-mode: t
  helm-mode: t
  helm-minibuffer-history-mode: t
  shell-dirtrack-mode: t
  helm-popup-tip-mode: t
  async-bytecomp-package-mode: t
  dired-async-mode: t
  minibuffer-depth-indicate-mode: t
  override-global-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
/home/thierry/.emacs.d/elpa/seq-2.23/seq hides /usr/local/share/emacs/29.0.50/lisp/emacs-lisp/seq

Features:
(shadow epa-mail face-remap emacsbug helm-command addressbook-bookmark
mu4e-config org-mu4e mu4e-contrib mu4e-patch mu4e mu4e-org mu4e-view
mu4e-main mu4e-headers mu4e-lists mu4e-compose mu4e-draft mu4e-actions
smtpmail sendmail mu4e-search mu4e-bookmarks mu4e-mark mu4e-message
flow-fill hl-line mu4e-contacts mu4e-update mu4e-folders mu4e-server
mu4e-context mu4e-vars mu4e-helpers ido mu4e-meta epa-file em-unix
em-term term disp-table ehelp em-script em-prompt em-ls em-hist em-pred
em-glob em-cmpl em-dirs esh-var em-basic em-banner em-alias esh-mode
esh-toggle char-fold image-file image-converter image-dired
tramp-archive tramp-gvfs tramp-cache zeroconf help-fns radix-tree
cl-print debug markdown-mode sh-script smie executable flymake-proc
flymake project org-element avl-tree generator ol-eww eww xdg url-queue
mm-url ol-rmail ol-mhe ol-irc ol-info ol-gnus nnselect gnus-search
eieio-opt speedbar ezimage dframe gnus-art mm-uu mml2015 mm-view
mml-smime smime dig gnus-sum shr pixel-fill kinsoku svg dom gnus-group
gnus-undo gnus-start gnus-dbus dbus gnus-cloud nnimap nnmail mail-source
utf7 netrc nnoo gnus-spec gnus-int gnus-range gnus-win ol-docview
doc-view ol-bibtex ol-bbdb ol-w3m ol-doi org-link-doi vc-filewise vc-rcs
conf-mode ledger-config ledger-mode ledger-check ledger-texi ledger-test
ledger-sort ledger-report ledger-reconcile ledger-occur ledger-fonts
ledger-fontify ledger-state ledger-complete ledger-schedule ledger-init
ledger-xact ledger-post ledger-exec ledger-navigate eshell esh-cmd
esh-ext esh-opt esh-proc esh-io esh-arg esh-module esh-groups esh-util
ledger-context ledger-commodities ledger-regex jka-compr bug-reference
naquadah-theme view solar cal-dst holidays hol-loaddefs tv-utils
yaml-mode undo-tree diff rainbow-mode color psession frameset log-view
pcvs-util pcmpl-git cl-indent ffap thingatpt autocrypt-message message
yank-media rmc puny rfc822 mml mml-sec mm-decode mm-bodies mm-encode
mail-parse rfc2231 rfc2047 rfc2045 mailabbrev gmm-utils mailheader
autocrypt-gnus gnus nnheader gnus-util mail-utils mm-util mail-prsvr
autocrypt-mu4e autocrypt ietf-drums config-w3m git-gutter bookmark
mule-util appt diary-lib diary-loaddefs gud pcomplete-extension
pcmpl-unix pcmpl-gnu iterator pcase wdired dired-extension org-config
ob-gnuplot org-crypt net-utils time all-the-icons all-the-icons-faces
data-material data-weathericons data-octicons data-fileicons
data-faicons data-alltheicons winner autotest-mode autoconf-mode woman
man ediff ediff-merg ediff-mult ediff-wind ediff-diff ediff-help
ediff-init ediff-util init-helm helm-ls-git vc-git diff-mode vc
vc-dispatcher helm-fd epa derived epg rfc6068 epg-config helm-epa
helm-imenu imenu helm-elisp-package helm-find helm-org org ob ob-tangle
ob-ref ob-lob ob-table ob-exp org-macro org-footnote org-src ob-comint
org-pcomplete org-list org-faces org-entities noutline outline
org-version ob-emacs-lisp ob-core ob-eval org-table oc-basic bibtex ol
org-keys oc org-compat advice org-macs org-loaddefs cal-menu calendar
cal-loaddefs helm-external helm-net xml isearch-light helm-descbinds
cus-edit pp wid-edit helm-ipython helm-elisp helm-eval edebug backtrace
find-func helm-info python tramp-sh helm-adaptive helm-mode helm-misc
helm-files image-mode exif filenotify tramp tramp-loaddefs trampver
tramp-integration files-x tramp-compat shell pcomplete parse-time
iso8601 time-date ls-lisp helm-buffers helm-occur helm-tags helm-locate
helm-grep wgrep-helm wgrep grep compile text-property-search comint
ansi-color ring helm-regexp format-spec helm-utils helm-help helm-types
helm-extensions-autoloads helm-config helm-autoloads helm async-bytecomp
helm-global-bindings helm-easymenu edmacro kmacro helm-source
helm-multi-match helm-lib dired-async dired-aux dired dired-loaddefs
async popup diminish mb-depth server comp comp-cstr warnings rx cl-extra
help-mode avoid cus-load use-package use-package-ensure
use-package-delight use-package-diminish use-package-bind-key bind-key
easy-mmode use-package-core finder-inf package browse-url url url-proxy
url-privacy url-expand url-methods url-history url-cookie url-domsuf
url-util mailcap url-handlers url-parse auth-source cl-seq eieio
eieio-core cl-macs eieio-loaddefs password-cache json map url-vars seq
seq-25 gv subr-x byte-opt bytecomp byte-compile cconv cl-loaddefs cl-lib
info w3m-load iso-transl tooltip eldoc paren electric uniquify
ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode lisp-mode prog-mode register
page tab-bar menu-bar rfn-eshadow isearch easymenu timer select
scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors
frame minibuffer cl-generic cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932
hebrew greek romanian slovak czech european ethiopic indian cyrillic
chinese composite emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice button
loaddefs faces cus-face macroexp files window text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget keymap
hashtable-print-readable backquote threads dbusbind inotify lcms2
dynamic-setting system-font-setting font-render-setting cairo
move-toolbar gtk x-toolkit x multi-tty make-network-process
native-compile emacs)

Memory information:
((conses 16 1200277 245333)
 (symbols 48 45481 5)
 (strings 32 258149 63600)
 (string-bytes 1 7493915)
 (vectors 16 88331)
 (vector-slots 8 2292913 224889)
 (floats 8 1601 626)
 (intervals 56 41303 662)
 (buffers 992 110))
<#secure method=pgpmime mode=sign>

-- 
Thierry




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#53229; Package emacs. (Thu, 13 Jan 2022 20:02:02 GMT) Full text and rfc822 format available.

Message #8 received at 53229 <at> debbugs.gnu.org (full text, mbox):

From: Thierry Volpiatto <thievol <at> posteo.net>
To: 53229 <at> debbugs.gnu.org
Subject: 29.0.50; Image-dired is not reusing thumbnails created in emacs-27
Date: Thu, 13 Jan 2022 19:53:23 +0000
[Message part 1 (text/plain, inline)]
After further searching, I discover image-dired is using sha1 to build
thumbnail filenames whereas in emacs-27 it uses md5, so the names are
differents and a new file is created.
I must use a different function to avoid duplicating all thumbnails,
using something like this:

    (cl-letf (((symbol-function 'sha1) #'md5))
      (image-dired-thumb-name file))

And while I was at it I used a cache to avoid calling md5 each time I
toggle or revisit an image directory with thumbnails, probably dired
should do the same as well, but it is a different issue.

-- 
Thierry
[signature.asc (application/pgp-signature, inline)]

Severity set to 'minor' from 'normal' Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Fri, 14 Jan 2022 01:54:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#53229; Package emacs. (Fri, 14 Jan 2022 07:57:02 GMT) Full text and rfc822 format available.

Message #13 received at 53229 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Thierry Volpiatto <thievol <at> posteo.net>
Cc: Stefan Kangas <stefan <at> marxist.se>, 53229 <at> debbugs.gnu.org
Subject: Re: bug#53229: 29.0.50; Image-dired is not reusing thumbnails
 created in emacs-27
Date: Fri, 14 Jan 2022 08:56:15 +0100
Thierry Volpiatto <thievol <at> posteo.net> writes:

> After further searching, I discover image-dired is using sha1 to build
> thumbnail filenames whereas in emacs-27 it uses md5, so the names are
> differents and a new file is created.

Stefan, was there any particular reason to switch from sha1 to md5 in
image-dired?  (Yes, I know that md5 is "broken", but if you have people
doing adversarial attacks on your image directories, you have bigger
problems.)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#53229; Package emacs. (Fri, 14 Jan 2022 08:40:02 GMT) Full text and rfc822 format available.

Message #16 received at 53229 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Lars Ingebrigtsen <larsi <at> gnus.org>, Thierry Volpiatto <thievol <at> posteo.net>
Cc: 53229 <at> debbugs.gnu.org
Subject: Re: bug#53229: 29.0.50; Image-dired is not reusing thumbnails created
 in emacs-27
Date: Fri, 14 Jan 2022 00:39:25 -0800
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Stefan, was there any particular reason to switch from sha1 to md5 in
> image-dired?

Mostly that it was marginally faster and I didn't expect any breakage.
I think we could either switch back, or make sure that we use the MD5
version of the file name if it exists and otherwise use SHA1.

>  (Yes, I know that md5 is "broken", but if you have people
> doing adversarial attacks on your image directories, you have bigger
> problems.)

But what about my tin foil?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#53229; Package emacs. (Fri, 14 Jan 2022 08:57:02 GMT) Full text and rfc822 format available.

Message #19 received at 53229 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: Thierry Volpiatto <thievol <at> posteo.net>, 53229 <at> debbugs.gnu.org
Subject: Re: bug#53229: 29.0.50; Image-dired is not reusing thumbnails
 created in emacs-27
Date: Fri, 14 Jan 2022 09:56:28 +0100
Stefan Kangas <stefan <at> marxist.se> writes:

> Mostly that it was marginally faster and I didn't expect any breakage.
> I think we could either switch back, or make sure that we use the MD5
> version of the file name if it exists and otherwise use SHA1.

If it wasn't significantly faster, I think I'd rather just switch back.
Computing the hash twice just seems like a too big complication...
but...  I don't really have an opinion -- either way is fine by me.

>>  (Yes, I know that md5 is "broken", but if you have people
>> doing adversarial attacks on your image directories, you have bigger
>> problems.)
>
> But what about my tin foil?

🎩

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#53229; Package emacs. (Fri, 14 Jan 2022 13:41:01 GMT) Full text and rfc822 format available.

Message #22 received at 53229 <at> debbugs.gnu.org (full text, mbox):

From: Thierry Volpiatto <thievol <at> posteo.net>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 53229 <at> debbugs.gnu.org
Subject: Re: bug#53229: 29.0.50; Image-dired is not reusing thumbnails
 created in emacs-27
Date: Fri, 14 Jan 2022 13:37:32 +0000
[Message part 1 (text/plain, inline)]
Stefan Kangas <stefan <at> marxist.se> writes:

> Lars Ingebrigtsen <larsi <at> gnus.org> writes:
>
>> Stefan, was there any particular reason to switch from sha1 to md5 in
>> image-dired?
>
> Mostly that it was marginally faster and I didn't expect any breakage.
> I think we could either switch back, or make sure that we use the MD5
> version of the file name if it exists and otherwise use SHA1.

If you do that you will have one call of MD5 and one of SHA1 on the same
file, which defeat the purpose of using SHA1 which is presumably faster.

-- 
Thierry
[signature.asc (application/pgp-signature, inline)]

Reply sent to Stefan Kangas <stefan <at> marxist.se>:
You have taken responsibility. (Fri, 14 Jan 2022 15:29:02 GMT) Full text and rfc822 format available.

Notification sent to Thierry Volpiatto <thievol <at> posteo.net>:
bug acknowledged by developer. (Fri, 14 Jan 2022 15:29:02 GMT) Full text and rfc822 format available.

Message #27 received at 53229-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Thierry Volpiatto <thievol <at> posteo.net>, 53229-done <at> debbugs.gnu.org
Subject: Re: bug#53229: 29.0.50; Image-dired is not reusing thumbnails created
 in emacs-27
Date: Fri, 14 Jan 2022 07:28:23 -0800
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> If it wasn't significantly faster, I think I'd rather just switch back.

Agreed, now done on master (commit bef9fcc999).




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#53229; Package emacs. (Fri, 14 Jan 2022 16:32:02 GMT) Full text and rfc822 format available.

Message #30 received at 53229-done <at> debbugs.gnu.org (full text, mbox):

From: Thierry Volpiatto <thievol <at> posteo.net>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 53229-done <at> debbugs.gnu.org
Subject: Re: bug#53229: 29.0.50; Image-dired is not reusing thumbnails
 created in emacs-27
Date: Fri, 14 Jan 2022 16:30:58 +0000
[Message part 1 (text/plain, inline)]
Stefan Kangas <stefan <at> marxist.se> writes:

> Lars Ingebrigtsen <larsi <at> gnus.org> writes:
>
>> If it wasn't significantly faster, I think I'd rather just switch back.
>
> Agreed, now done on master (commit bef9fcc999).

Thanks!

-- 
Thierry
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 12 Feb 2022 12:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 81 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.