From unknown Sat Jun 21 05:18:34 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#61394 <61394@debbugs.gnu.org> To: bug#61394 <61394@debbugs.gnu.org> Subject: Status: 30.0.50; [PATCH] Image-dired thumb name based on content Reply-To: bug#61394 <61394@debbugs.gnu.org> Date: Sat, 21 Jun 2025 12:18:34 +0000 retitle 61394 30.0.50; [PATCH] Image-dired thumb name based on content reassign 61394 emacs submitter 61394 Manuel Giraud severity 61394 normal tag 61394 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 09 14:07:05 2023 Received: (at submit) by debbugs.gnu.org; 9 Feb 2023 19:07:05 +0000 Received: from localhost ([127.0.0.1]:33741 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pQCG8-0004oW-V6 for submit@debbugs.gnu.org; Thu, 09 Feb 2023 14:07:05 -0500 Received: from lists.gnu.org ([209.51.188.17]:33834) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pQCG6-0004oD-DW for submit@debbugs.gnu.org; Thu, 09 Feb 2023 14:07:03 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pQCG5-00083e-Me for bug-gnu-emacs@gnu.org; Thu, 09 Feb 2023 14:07:01 -0500 Received: from ledu-giraud.fr ([51.159.28.247]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pQCG1-0001no-Uc for bug-gnu-emacs@gnu.org; Thu, 09 Feb 2023 14:07:01 -0500 DKIM-Signature: v=1; a=ed25519-sha256; c=simple/simple; s=ed25519; bh=Mke3WDAv XHQycfef713bCxjrVAUI4LkFBTEzzrw0d50=; h=date:subject:to:from; d=ledu-giraud.fr; b=2LBqGjXA1c+WoWMkeinxDMMwe66aujYRNY1e2Uid88usMGaK5o IgSnrrFmELlAUIcO6c4Q1Q14vJY8/reMlhAw== DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=Mke3WDAvXHQycfef 713bCxjrVAUI4LkFBTEzzrw0d50=; h=date:subject:to:from; d=ledu-giraud.fr; b=hqRy5geudYHFrK3du0LE795/KMIxOR+ErOGQdFK6cDlvpezbn7 pHGGGnYgetvn3toxqcHwJ1FRzyh9RED5xkYFzzzOWkYIfceBQxanWhFePHBnhoXhmCiw8J DKOczlQgzpd0nNVfviJrZc/x9OVKsrmEgdqDuYwkQGgTToOXCgVOHMH4uaIvRNbgyKZ+cU yZZKvzgDZqbpDgl8gTCMDv+H5j7r+f5VwOBDOx3B9rbXVgU0YwijRWMVHvkY0R2LTg2I75 pez31+Bc55IMhPETjU6NZXs6OvlDM2pw+ujhP/qsVReiGnA4vbNwp83hmM3NBH345KUTy/ BaMl9dE+hmPg== Received: from computer ( [10.1.1.1]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id 70202292 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Thu, 9 Feb 2023 20:06:52 +0100 (CET) From: Manuel Giraud To: bug-gnu-emacs@gnu.org Subject: 30.0.50; [PATCH] Image-dired thumb name based on content Date: Thu, 09 Feb 2023 20:06:50 +0100 Message-ID: <874jruy7xx.fsf@ledu-giraud.fr> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=51.159.28.247; envelope-from=manuel@ledu-giraud.fr; helo=ledu-giraud.fr X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) --=-=-= Content-Type: text/plain Hi, Here is a proposal for a modification of how image-dired generates thumb names. With this patch, a thumb name will depend on the content of the associated image. Pros: - the thumb name is unique even if the file is moved or renamed - you keep a centralized thumb directory Cons: - none (as it fits my usage :-) --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Image-dired-thumb-name-based-on-content.patch >From 017bb36bdff40383b170e8ee5cff00034595a6ce Mon Sep 17 00:00:00 2001 From: Manuel Giraud Date: Thu, 9 Feb 2023 19:56:37 +0100 Subject: [PATCH] Image-dired thumb name based on content * lisp/image/image-dired-util.el (image-dired-content-sha1): New utility that compute the SHA-1 of a part of the content of a file. (image-dired-thumb-name): Use it. --- lisp/image/image-dired-util.el | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lisp/image/image-dired-util.el b/lisp/image/image-dired-util.el index c03f9d2e3d3..58c96f7f20b 100644 --- a/lisp/image/image-dired-util.el +++ b/lisp/image/image-dired-util.el @@ -57,13 +57,19 @@ image-dired-dir (message "Thumbnail directory created: %s" image-dired-dir)) image-dired-dir)) +(defun image-dired-content-sha1 (filename) + "Compute the SHA-1 of a part of FILENAME." + (with-temp-buffer + (let ((file-size (file-attribute-size (file-attributes filename))) + (chunk-size 4096)) + (insert-file-contents filename nil 0 (min chunk-size file-size)) + (sha1 (current-buffer))))) + (defun image-dired-thumb-name (file) "Return absolute file name for thumbnail FILE. Depending on the value of `image-dired-thumbnail-storage', the file name of the thumbnail will vary: -- For `use-image-dired-dir', make a SHA1-hash of the image file's - directory name and add that to make the thumbnail file name - unique. +- For `image-dired', make a SHA1-hash of some of the image file. - For `per-directory' storage, just add a subdirectory. - For `standard' storage, produce the file name according to the Thumbnail Managing Standard. Among other things, an MD5-hash @@ -85,7 +91,7 @@ image-dired-thumb-name ((or (eq 'image-dired image-dired-thumbnail-storage) ;; Maintained for backwards compatibility: (eq 'use-image-dired-dir image-dired-thumbnail-storage)) - (expand-file-name (format "%s.jpg" (sha1 file)) + (expand-file-name (format "%s.jpg" (image-dired-content-sha1 file)) (image-dired-dir))) ((eq 'per-directory image-dired-thumbnail-storage) (expand-file-name (format "%s.thumb.jpg" -- 2.39.0 --=-=-= Content-Type: text/plain In GNU Emacs 30.0.50 (build 1, x86_64-unknown-openbsd7.2, cairo version 1.17.6) of 2023-02-09 built on computer Repository revision: 1518fc5d7c5bedbbe35053696c7ec06020c81b05 Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12101004 System Description: OpenBSD computer 7.2 GENERIC.MP#933 amd64 Configured using: 'configure --prefix=/home/manuel/emacs --bindir=/home/manuel/bin --with-x-toolkit=no --without-sound --without-compress-install CPPFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib' Configured features: CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBOTF LIBXML2 MODULES NOTIFY KQUEUE OLDXMENU PDUMPER PNG RSVG SQLITE3 THREADS TIFF TREE_SITTER WEBP X11 XDBE XIM XINPUT2 XPM ZLIB Important settings: value of $LC_ALL: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Dired by name Minor modes in effect: global-git-commit-mode: t magit-auto-revert-mode: t gnus-dired-mode: t display-time-mode: t display-battery-mode: t server-mode: t shell-dirtrack-mode: t repeat-mode: t desktop-save-mode: t global-eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t buffer-read-only: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: /home/manuel/.emacs.d/elpa/ef-themes-0.10.0/theme-loaddefs hides /home/manuel/emacs/share/emacs/30.0.50/lisp/theme-loaddefs /home/manuel/.emacs.d/elpa/transient-0.3.7/transient hides /home/manuel/emacs/share/emacs/30.0.50/lisp/transient Features: (shadow sort mail-extr macros emacsbug whitespace magit-patch wdired magit-extras face-remap magit-bookmark magit-submodule magit-obsolete magit-blame magit-stash magit-reflog magit-bisect magit-push magit-pull magit-fetch magit-clone magit-remote magit-commit magit-sequence magit-notes magit-worktree magit-tag magit-merge magit-branch magit-reset magit-files magit-refs magit-status magit magit-repos magit-apply magit-wip magit-log which-func magit-diff smerge-mode diff git-commit log-edit pcvs-util magit-core magit-autorevert magit-margin magit-transient magit-process with-editor magit-mode transient magit-git magit-section benchmark shortdoc executable dabbrev find-dired ffap tabify cus-start image-dired-dired pulse misearch multi-isearch cl-print help-fns radix-tree magit-utils dash image-file image-converter image-dired image-dired-tags image-dired-external image-dired-util org-indent org-element org-persist org-id org-refile avl-tree oc-basic ol-eww ol-rmail ol-mhe ol-irc ol-info ol-gnus nnselect ol-docview ol-bibtex bibtex ol-bbdb ol-w3m ol-doi org-link-doi texinfo texinfo-loaddefs reveal rng-xsd xsd-regexp rng-cmpct rng-nxml rng-valid rng-loc rng-uri rng-parse nxml-parse rng-match rng-dt rng-util rng-pttrn nxml-ns nxml-mode nxml-outln nxml-rap nxml-util nxml-enc xmltok css-mode treesit smie sgml-mode facemenu imenu eww xdg url-queue mm-url doc-view jka-compr image-mode exif view pascal bug-reference paredit edmacro vc-hg vc-svn conf-mode vc-dir ewoc vc autorevert filenotify vc-git diff-mode vc-dispatcher add-log gnus-dired time battery exwm-randr xcb-randr exwm-config exwm exwm-input xcb-keysyms xcb-xkb exwm-manage exwm-floating xcb-cursor xcb-render exwm-layout exwm-workspace exwm-core xcb-ewmh xcb-icccm xcb xcb-xproto xcb-types xcb-debug kmacro server stimmung-themes modus-operandi-theme modus-themes ytdious osm mingus libmpdee reporter edebug debug backtrace transmission diary-lib diary-loaddefs color calc-bin calc-ext calc calc-loaddefs rect calc-macs w3m-load mu4e mu4e-org mu4e-main mu4e-view mu4e-headers mu4e-compose mu4e-draft mu4e-actions smtpmail mu4e-search mu4e-lists mu4e-bookmarks mu4e-mark mu4e-message flow-fill mule-util hl-line mu4e-contacts mu4e-update mu4e-folders mu4e-server mu4e-context mu4e-vars mu4e-helpers mu4e-config bookmark ido supercite regi ebdb-message ebdb-gnus gnus-msg gnus-art mm-uu mml2015 mm-view mml-smime smime gnutls dig gnus-sum shr pixel-fill kinsoku url-file svg dom gnus-group gnus-undo gnus-start gnus-dbus gnus-cloud nnimap nnmail mail-source utf7 nnoo gnus-spec gnus-int gnus-range message sendmail yank-media puny rfc822 mml mml-sec epa epg rfc6068 epg-config mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums gmm-utils mailheader gnus-win gnus nnheader gnus-util mail-utils range mm-util mail-prsvr ebdb-mua ebdb-com crm ebdb-format ebdb mailabbrev eieio-opt cl-extra help-mode speedbar ezimage dframe eieio-base pcase timezone org ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macro org-src ob-comint org-pcomplete org-list org-footnote org-faces org-entities ob-emacs-lisp ob-core ob-eval org-cycle org-table ol org-fold org-fold-core org-keys oc org-loaddefs find-func cal-menu calendar cal-loaddefs org-version org-compat org-macs visual-basic-mode cl web-mode derived disp-table erlang-start smart-tabs-mode skeleton cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs slime-asdf grep slime-tramp tramp rx tramp-loaddefs trampver tramp-integration cus-edit cus-load wid-edit files-x tramp-compat shell pcomplete parse-time iso8601 time-date ls-lisp format-spec slime-fancy slime-indentation slime-cl-indent cl-indent slime-trace-dialog slime-fontifying-fu slime-package-fu slime-references slime-compiler-notes-tree advice slime-scratch slime-presentations bridge slime-macrostep macrostep slime-mdot-fu slime-enclosing-context slime-fuzzy slime-fancy-trace slime-fancy-inspector slime-c-p-c slime-editing-commands slime-autodoc slime-repl slime-parse slime apropos compile text-property-search etags fileloop generator xref project arc-mode archive-mode noutline outline icons pp comint ansi-osc ansi-color ring hyperspec thingatpt slime-autoloads dired-aux dired-x dired dired-loaddefs notifications dbus xml repeat easy-mmode desktop frameset stimmung-themes-autoloads rust-mode-autoloads ebdb-autoloads magit-autoloads debbugs-autoloads git-commit-autoloads magit-section-autoloads ef-themes-autoloads with-editor-autoloads paredit-autoloads dash-autoloads ytdious-autoloads transmission-autoloads transient-autoloads exwm-autoloads hyperbole-autoloads detached-autoloads info package browse-url url url-proxy url-privacy url-expand url-methods url-history url-cookie generate-lisp-file url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs password-cache json subr-x map byte-opt gv bytecomp byte-compile url-vars cl-loaddefs cl-lib rmc iso-transl tooltip cconv 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 nadvice seq simple cl-generic indonesian philippine 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 abbrev obarray oclosure cl-preloaded button loaddefs theme-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 kqueue lcms2 dynamic-setting system-font-setting font-render-setting cairo xinput2 x multi-tty make-network-process emacs) Memory information: ((conses 16 890208 177320) (symbols 48 60888 5) (strings 32 208408 17024) (string-bytes 1 6407691) (vectors 16 117900) (vector-slots 8 2299033 117223) (floats 8 645 483) (intervals 56 40488 2510) (buffers 984 144)) -- Manuel Giraud --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 10 10:13:38 2023 Received: (at 61394) by debbugs.gnu.org; 10 Feb 2023 15:13:38 +0000 Received: from localhost ([127.0.0.1]:37903 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pQV5l-0007EM-QC for submit@debbugs.gnu.org; Fri, 10 Feb 2023 10:13:38 -0500 Received: from mail-wm1-f45.google.com ([209.85.128.45]:52946) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pQV5j-0007E9-Jc for 61394@debbugs.gnu.org; Fri, 10 Feb 2023 10:13:37 -0500 Received: by mail-wm1-f45.google.com with SMTP id z13so4060712wmp.2 for <61394@debbugs.gnu.org>; Fri, 10 Feb 2023 07:13:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd.ie; s=google21; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=4wWUq6VnspIdCTNUlLCBOnhClmEtyRHPiq7jZhPvIY0=; b=gDhfQ4KMvM4GR9dsSP7yuufs5I75O5m46psYH/hxR9JIxFKoHqAeYsx7zv+BPCgCL9 iX3Wu0fXUW72P0sWIWz51eHZBQ0W3dO+gPS0n3mUBSfZtzViHTbt6J3JjJYWCn/DYlE1 UaXxNOGMRjUMMgk2myWOZYNTNp99LF7qrDVj393RNEp4Q55NVjvnSwxN8oIyVkEF3VVG FN+tcMSCbiohDCllbqUlXEunJ+xQz46gNNOfSJ3jSclyd2lfOABbGdWZd/LX1JpnGBF3 bwCwflsHcxbFv+Dqg8TaJTAzHVTH5Lk6Xrn1m7Y9dbbGT+A4lDCed23GwyIG1jfnOKyE KxOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=4wWUq6VnspIdCTNUlLCBOnhClmEtyRHPiq7jZhPvIY0=; b=Rxi9DMr+ndfs6xu6tRY8xcRmUgiFJorhfLarPkZHyRoCPsYl7/ORFAhBjyD1fk3KUn 5S3qrz7XxCS1eEmnfUa430rIJPUrgmKV4AJaWVqiGTw8j4xj8BMDIzNqcTEXgVeG7gNR bXaGpKZtKoMQQvH4C6Enmv5FxiYsP4mOsvCrVQ1db3Uf84CEiQ90gGz8lHRAbi8gXK5i r5pbFr12K4keaD7M342rJQnM/PSRTwdonjnOLInTNZ9fBvs8WftRwzKefyPAMilcV/m/ lkICmMu24bAQt93kGG6lr1xcjq9NU+vtY3ujQQn39PTDVVpqLnwdAfDcktcaiIur3Csl 7QOg== X-Gm-Message-State: AO0yUKWQCx6KjhZ1Ciq9QMo8ZpeIFN+x6/5Zyr9LmjrNlu42Ja2S55EE 4wDM4r2VsurVpnn3Z+YuXQ6H4Eg85NSQ6+Yj X-Google-Smtp-Source: AK7set8O5nslBCndLrobwihd+qgnu/fSZCY+XtkUbQ8f1eIh2bQwvjyJvEPxMaPX9A01KBJ3eY6yJA== X-Received: by 2002:a05:600c:34d0:b0:3da:fcb7:39e5 with SMTP id d16-20020a05600c34d000b003dafcb739e5mr13261587wmq.23.1676042009442; Fri, 10 Feb 2023 07:13:29 -0800 (PST) Received: from localhost ([217.173.96.166]) by smtp.gmail.com with ESMTPSA id q14-20020a05600c46ce00b003db12112fcfsm5998574wmo.4.2023.02.10.07.13.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Feb 2023 07:13:28 -0800 (PST) From: Basil Contovounesios To: 61394@debbugs.gnu.org Subject: Re: bug#61394: 30.0.50; [PATCH] Image-dired thumb name based on content In-Reply-To: <874jruy7xx.fsf@ledu-giraud.fr> (Manuel Giraud via "Bug reports for GNU Emacs, the Swiss army knife of text editors"'s message of "Thu, 09 Feb 2023 20:06:50 +0100") References: <874jruy7xx.fsf@ledu-giraud.fr> Date: Fri, 10 Feb 2023 15:13:27 +0000 Message-ID: <87ttztk0yw.fsf@tcd.ie> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 61394 Cc: Manuel Giraud X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Manuel Giraud via "Bug reports for GNU Emacs, the Swiss army knife of text editors" [2023-02-09 20:06 +0100] wrote: > +(defun image-dired-content-sha1 (filename) > + "Compute the SHA-1 of a part of FILENAME." > + (with-temp-buffer > + (let ((file-size (file-attribute-size (file-attributes filename))) > + (chunk-size 4096)) > + (insert-file-contents filename nil 0 (min chunk-size file-size)) Can't we unconditionally pass END=chunk-size to insert-file-contents, even for smaller files? Thanks, -- Basil From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 10 13:46:10 2023 Received: (at 61394) by debbugs.gnu.org; 10 Feb 2023 18:46:10 +0000 Received: from localhost ([127.0.0.1]:38130 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pQYPS-0004SA-BM for submit@debbugs.gnu.org; Fri, 10 Feb 2023 13:46:10 -0500 Received: from ledu-giraud.fr ([51.159.28.247]:43642) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pQYPO-0004Rz-16 for 61394@debbugs.gnu.org; Fri, 10 Feb 2023 13:46:09 -0500 DKIM-Signature: v=1; a=ed25519-sha256; c=simple/simple; s=ed25519; bh=RfPKPaOx 5v4VWy8jqJ07sqzJbHNTLQv32xbZmIRnOjI=; h=date:references:in-reply-to: subject:cc:to:from; d=ledu-giraud.fr; b=UKyMhI/lGvzsG2zeSIzsbCNgcxFN8P iKwCKWlDTjeG3KT21V6fh7emJPFDYyFb8EoOnIZHPdgHp/n6VXS8iGBg== DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=RfPKPaOx5v4VWy8j qJ07sqzJbHNTLQv32xbZmIRnOjI=; h=date:references:in-reply-to:subject: cc:to:from; d=ledu-giraud.fr; b=DMlrP/e8gbrESgKprdwQQ95r3hOO2mgAkrkeYC AcJVeH2tNSN+948CDf78ELA3dwhSrQ7TNaZlGfyd11yeI7s4k3s+AREMr9AxTtNU5YwLaT 29SWs+g65ujTDFk/zQJTMO4U3jhn/7W3itIqtAHwXs2vjqUy2/Kb2PfSCnQUjWpEQlgeoA Yl5aqUiFYBcLqAqHmn4lQ/hHdfcs7jTQpt84N2hSh++u5wRQ31dHHJjByiyhiuetOrfQUz m1dvNaQ8Fac/FZjX2ykzk4NKllDUJhgs0I8+8J7AVlrKKsav37ZqHYlQl+r4E189AMriZ9 Mz67WzliHT+z5oJMP3s5udbA== Received: from computer ( [10.1.1.1]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id 89aee651 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Fri, 10 Feb 2023 19:46:03 +0100 (CET) From: Manuel Giraud To: Basil Contovounesios Subject: Re: bug#61394: 30.0.50; [PATCH] Image-dired thumb name based on content In-Reply-To: <87ttztk0yw.fsf@tcd.ie> (Basil Contovounesios's message of "Fri, 10 Feb 2023 15:13:27 +0000") References: <874jruy7xx.fsf@ledu-giraud.fr> <87ttztk0yw.fsf@tcd.ie> Date: Fri, 10 Feb 2023 19:46:02 +0100 Message-ID: <87v8k9s6j9.fsf@ledu-giraud.fr> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 61394 Cc: 61394@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Basil Contovounesios writes: > Manuel Giraud via "Bug reports for GNU Emacs, the Swiss army knife of > text editors" [2023-02-09 20:06 +0100] wrote: > >> +(defun image-dired-content-sha1 (filename) >> + "Compute the SHA-1 of a part of FILENAME." >> + (with-temp-buffer >> + (let ((file-size (file-attribute-size (file-attributes filename))) >> + (chunk-size 4096)) >> + (insert-file-contents filename nil 0 (min chunk-size file-size)) > > Can't we unconditionally pass END=chunk-size to insert-file-contents, > even for smaller files? >From fileio.c:4076, it seems that you are right: --8<---------------cut here---------------start------------->8--- /* The likely offset where we will stop reading. We could read more (or less), if the file grows (or shrinks) as we read it. */ off_t likely_end = min (end_offset, st.st_size); --8<---------------cut here---------------end--------------->8--- So here is an update version of this patch. I've tested it on small 400 bytes icons and it works also. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Image-dired-thumb-name-based-on-content.patch >From f568717f7492c57fbf248ac4dd8d16cd22a24443 Mon Sep 17 00:00:00 2001 From: Manuel Giraud Date: Thu, 9 Feb 2023 19:56:37 +0100 Subject: [PATCH] Image-dired thumb name based on content * lisp/image/image-dired-util.el (image-dired-content-sha1): New utility that compute the SHA-1 of a part of the content of a file. (image-dired-thumb-name): Use it. --- lisp/image/image-dired-util.el | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lisp/image/image-dired-util.el b/lisp/image/image-dired-util.el index c03f9d2e3d3..e54879ce033 100644 --- a/lisp/image/image-dired-util.el +++ b/lisp/image/image-dired-util.el @@ -57,13 +57,17 @@ image-dired-dir (message "Thumbnail directory created: %s" image-dired-dir)) image-dired-dir)) +(defun image-dired-content-sha1 (filename) + "Compute the SHA-1 of a part of FILENAME." + (with-temp-buffer + (insert-file-contents filename nil 0 4096) + (sha1 (current-buffer)))) + (defun image-dired-thumb-name (file) "Return absolute file name for thumbnail FILE. Depending on the value of `image-dired-thumbnail-storage', the file name of the thumbnail will vary: -- For `use-image-dired-dir', make a SHA1-hash of the image file's - directory name and add that to make the thumbnail file name - unique. +- For `image-dired', make a SHA1-hash of some of the image file. - For `per-directory' storage, just add a subdirectory. - For `standard' storage, produce the file name according to the Thumbnail Managing Standard. Among other things, an MD5-hash @@ -85,7 +89,7 @@ image-dired-thumb-name ((or (eq 'image-dired image-dired-thumbnail-storage) ;; Maintained for backwards compatibility: (eq 'use-image-dired-dir image-dired-thumbnail-storage)) - (expand-file-name (format "%s.jpg" (sha1 file)) + (expand-file-name (format "%s.jpg" (image-dired-content-sha1 file)) (image-dired-dir))) ((eq 'per-directory image-dired-thumbnail-storage) (expand-file-name (format "%s.thumb.jpg" -- 2.39.1 --=-=-= Content-Type: text/plain Thanks, -- Manuel Giraud --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 11 04:51:15 2023 Received: (at 61394) by debbugs.gnu.org; 11 Feb 2023 09:51:15 +0000 Received: from localhost ([127.0.0.1]:38745 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pQmXL-0003bm-1F for submit@debbugs.gnu.org; Sat, 11 Feb 2023 04:51:15 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52724) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pQmXG-0003bV-Sv for 61394@debbugs.gnu.org; Sat, 11 Feb 2023 04:51:13 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pQmXA-0004dU-RF; Sat, 11 Feb 2023 04:51:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=MiX6sbF9e2nM4KUVPb2pUx2ONYiIRMrNIGQLzWDOeoE=; b=O3BHcya8gtkp BU165rdbsgu87+BOw8aLuLAkNcXYXxdj0C7lh8o/RHhbBGtzq3l901JtLLRTyZu3ORwBGc+qje00O tVfg5zld6wFnHJUUk6VTnk9HjGO1Tnph3UDs6dGeQDXNpH7yKhUhyIEDokG4Cj+4mz05ioTtRIZXG CVLtDm/MwVOHnxiCPnpVyGt/MDZYuJW0awTzd1KbXDhEXSgpRQsMsFy9dDK59XlYIvDPjZrjDdeCl nerDuFDigCvDsOKCXrKc4W2Eb7tezE/Fp6PPbThVG3p+EpLpuG5i73crCc8S5TSJRGBVbKvpT5PM3 F5CaAJQAFx49ehquKjdnaQ==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pQmX9-0001w6-Vu; Sat, 11 Feb 2023 04:51:04 -0500 Date: Sat, 11 Feb 2023 11:50:33 +0200 Message-Id: <83ilg8jzti.fsf@gnu.org> From: Eli Zaretskii To: Manuel Giraud In-Reply-To: <87v8k9s6j9.fsf@ledu-giraud.fr> (bug-gnu-emacs@gnu.org) Subject: Re: bug#61394: 30.0.50; [PATCH] Image-dired thumb name based on content References: <874jruy7xx.fsf@ledu-giraud.fr> <87ttztk0yw.fsf@tcd.ie> <87v8k9s6j9.fsf@ledu-giraud.fr> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 61394 Cc: contovob@tcd.ie, 61394@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: 61394@debbugs.gnu.org > Date: Fri, 10 Feb 2023 19:46:02 +0100 > From: Manuel Giraud via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > +(defun image-dired-content-sha1 (filename) > + "Compute the SHA-1 of a part of FILENAME." Not "part of FILENAME", but "the first 4KiB of FILENAME's contents". Btw, using only the first 4KiB would mean a collision is still possible, albeit rarely, right? So your use case of having all the thumbnails in the same directory could sometimes fail, right? > + (with-temp-buffer > + (insert-file-contents filename nil 0 4096) Please use insert-file-contents-literally here. It should be much faster, and we only care about the file's bytestream anyway. > (defun image-dired-thumb-name (file) > "Return absolute file name for thumbnail FILE. > Depending on the value of `image-dired-thumbnail-storage', the > file name of the thumbnail will vary: > -- For `use-image-dired-dir', make a SHA1-hash of the image file's > - directory name and add that to make the thumbnail file name > - unique. > +- For `image-dired', make a SHA1-hash of some of the image file. > - For `per-directory' storage, just add a subdirectory. > - For `standard' storage, produce the file name according to the > Thumbnail Managing Standard. Among other things, an MD5-hash This doc string "needs work". Could you please fix it as part of the patch, even though most of the problems are not due to this patch? In any case, please either say here that only the first 4KiB of the file's contents are SHA1-hashed or include a link to the new function. From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 11 07:30:58 2023 Received: (at 61394) by debbugs.gnu.org; 11 Feb 2023 12:30:58 +0000 Received: from localhost ([127.0.0.1]:39141 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pQp1u-0004Zz-3g for submit@debbugs.gnu.org; Sat, 11 Feb 2023 07:30:58 -0500 Received: from ledu-giraud.fr ([51.159.28.247]:44426) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pQp1o-0004Wo-8Q for 61394@debbugs.gnu.org; Sat, 11 Feb 2023 07:30:56 -0500 DKIM-Signature: v=1; a=ed25519-sha256; c=simple/simple; s=ed25519; bh=NNkl4paD FR9LGqBxXWUXA1M9CmLlcwjX7eokDFllVVs=; h=date:references:in-reply-to: subject:cc:to:from; d=ledu-giraud.fr; b=/ntnvdF4rKv26f3rfViOkDUfcKGAMk ecvr2rqv2SoeovxS3vaoXJP2xeXEo9sN8oi8c5C3G1vNSM3fwc6FZvBg== DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=NNkl4paDFR9LGqBx XWUXA1M9CmLlcwjX7eokDFllVVs=; h=date:references:in-reply-to:subject: cc:to:from; d=ledu-giraud.fr; b=lh5bDFA5NTqpxeMMw+mSpzwkJyK/WDN3wyHYHO 5j4pgOaB/P2A1zjKxIFQWzHG4f1ekECt4k2hoDc2JuQ9/xmlLf6LeGZGKQIpdZ08AE8REb HqSwASViB6KEPjA/x+LFg2449lB4bkZIYP8ou9sxdZtLDZCdb0knex1uG99h1XVpLkvwtK fuFPjm+EY4imAp6POP8NEnRTv99w90gPSja/DL5AWHeAUlaWaPNeF8pM/9o3/KdgANtN7/ KvzJRQbYB+OuNKH3Wcnrod7LhdAv22g3+DorF7iceQj9gxeNvMD127U5slxtFl9H7mnJtn PXjQkwFGFpAB77ZqJ2pJYJCw== Received: from computer ( [10.1.1.1]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id f0fc1e84 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Sat, 11 Feb 2023 13:30:50 +0100 (CET) From: Manuel Giraud To: Eli Zaretskii Subject: Re: bug#61394: 30.0.50; [PATCH] Image-dired thumb name based on content In-Reply-To: <83ilg8jzti.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 11 Feb 2023 11:50:33 +0200") References: <874jruy7xx.fsf@ledu-giraud.fr> <87ttztk0yw.fsf@tcd.ie> <87v8k9s6j9.fsf@ledu-giraud.fr> <83ilg8jzti.fsf@gnu.org> Date: Sat, 11 Feb 2023 13:30:48 +0100 Message-ID: <87k00oo03r.fsf@ledu-giraud.fr> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 61394 Cc: contovob@tcd.ie, 61394@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: >> Cc: 61394@debbugs.gnu.org >> Date: Fri, 10 Feb 2023 19:46:02 +0100 >> From: Manuel Giraud via "Bug reports for GNU Emacs, >> the Swiss army knife of text editors" >> >> +(defun image-dired-content-sha1 (filename) >> + "Compute the SHA-1 of a part of FILENAME." > > Not "part of FILENAME", but "the first 4KiB of FILENAME's contents". Yes, I'll fix that. > Btw, using only the first 4KiB would mean a collision is still > possible, albeit rarely, right? So your use case of having all the > thumbnails in the same directory could sometimes fail, right? The 4KiB was "quite large but not so much" guess. I've made tests with the following code: --8<---------------cut here---------------start------------->8--- (defun sha1-test (filename size) (with-temp-buffer (insert-file-contents-literally filename nil 0 size) (sha1 (current-buffer)))) ;; From 1KiB to 64KiB (list (benchmark-run-compiled 1000 (sha1-test "/tmp/a-5MiB-photo.jpg" (expt 2 10))) (benchmark-run-compiled 1000 (sha1-test "/tmp/a-5MiB-photo.jpg" (expt 2 11))) (benchmark-run-compiled 1000 (sha1-test "/tmp/a-5MiB-photo.jpg" (expt 2 12))) (benchmark-run-compiled 1000 (sha1-test "/tmp/a-5MiB-photo.jpg" (expt 2 13))) (benchmark-run-compiled 1000 (sha1-test "/tmp/a-5MiB-photo.jpg" (expt 2 14))) (benchmark-run-compiled 1000 (sha1-test "/tmp/a-5MiB-photo.jpg" (expt 2 15))) (benchmark-run-compiled 1000 (sha1-test "/tmp/a-5MiB-photo.jpg" (expt 2 16)))) --8<---------------cut here---------------end--------------->8--- And here are the results on my machine: ((0.664336771 1 0.14466495299998883) (0.707937024 2 0.28811983400001395) (0.940229304 3 0.44037704100000497) ;; <- 4KiB (1.672118528 4 0.7672738199999856) (2.6194289370000003 6 1.046699996000001) (3.169999951 11 1.5916382949999957) (6.547043287 21 3.195145416999992)) So this 4KiB seems practical: about 1 second for one thousand run. WDYT? About collision, my wild guess here is that, as we are considering images, most of the modifications on these images we'll have an impact on those first 4KiB anyway. But you're that collision is still possible and the thumb could be wrong. I'll try to find out what is the probability of a SHA-1 collision on 4KiB of data. >> + (with-temp-buffer >> + (insert-file-contents filename nil 0 4096) > > Please use insert-file-contents-literally here. It should be much > faster, and we only care about the file's bytestream anyway. Thanks, I'll do that too. >> (defun image-dired-thumb-name (file) >> "Return absolute file name for thumbnail FILE. >> Depending on the value of `image-dired-thumbnail-storage', the >> file name of the thumbnail will vary: >> -- For `use-image-dired-dir', make a SHA1-hash of the image file's >> - directory name and add that to make the thumbnail file name >> - unique. >> +- For `image-dired', make a SHA1-hash of some of the image file. >> - For `per-directory' storage, just add a subdirectory. >> - For `standard' storage, produce the file name according to the >> Thumbnail Managing Standard. Among other things, an MD5-hash > > This doc string "needs work". Could you please fix it as part of the > patch, even though most of the problems are not due to this patch? In > any case, please either say here that only the first 4KiB of the file's > contents are SHA1-hashed or include a link to the new function. You're right it is even not complete for `per-directory'. I could try to come up with a fix. Thanks. -- Manuel Giraud From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 11 09:54:05 2023 Received: (at 61394) by debbugs.gnu.org; 11 Feb 2023 14:54:05 +0000 Received: from localhost ([127.0.0.1]:39204 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pQrGO-0008WA-O4 for submit@debbugs.gnu.org; Sat, 11 Feb 2023 09:54:05 -0500 Received: from eggs.gnu.org ([209.51.188.92]:58234) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pQrGL-0008VC-Pa for 61394@debbugs.gnu.org; Sat, 11 Feb 2023 09:54:04 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pQrGF-0000e6-SS; Sat, 11 Feb 2023 09:53:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=E2SaJvJ9tR/p1gTRBHyYbI1EyvPIXF1aOC2rZC6Gcng=; b=T6H+Q9DC6anN FvsHJiMUTDq8F2+Xr+kGn3nOz37v1pP4Hk6a0H5V8BNUlYbyJLOHUJKnPZ5liAGT/dGp9/33dmI6R 0B2AsbvCZzoG5yk7W2m5ZeK/Stop0ceJifE6tMoAtL1SsrBOcB934cn5OewSjVt9YtHgfKLlYtHpk GxHAjhbZ28SXlOCNXd9AFuS4K3GFkT0rdtJzetnbfpwtS3x2ga3g8Qvj5Ms7ay4Trl7Q5WSNDtCWa hBA08Wa3MSTqLatXjhqNV3puzRUyquc8M9I/NgPgnIj6JkROlkxd4wG/nHQyoXOXOsSz6rxw7RcPA 2fvUrAzFWpeHZHO8iFAbEQ==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pQrGF-000440-8e; Sat, 11 Feb 2023 09:53:55 -0500 Date: Sat, 11 Feb 2023 16:53:25 +0200 Message-Id: <838rh4jlsq.fsf@gnu.org> From: Eli Zaretskii To: Manuel Giraud In-Reply-To: <87k00oo03r.fsf@ledu-giraud.fr> (message from Manuel Giraud on Sat, 11 Feb 2023 13:30:48 +0100) Subject: Re: bug#61394: 30.0.50; [PATCH] Image-dired thumb name based on content References: <874jruy7xx.fsf@ledu-giraud.fr> <87ttztk0yw.fsf@tcd.ie> <87v8k9s6j9.fsf@ledu-giraud.fr> <83ilg8jzti.fsf@gnu.org> <87k00oo03r.fsf@ledu-giraud.fr> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 61394 Cc: contovob@tcd.ie, 61394@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Manuel Giraud > Cc: contovob@tcd.ie, 61394@debbugs.gnu.org > Date: Sat, 11 Feb 2023 13:30:48 +0100 > > > Btw, using only the first 4KiB would mean a collision is still > > possible, albeit rarely, right? So your use case of having all the > > thumbnails in the same directory could sometimes fail, right? > > The 4KiB was "quite large but not so much" guess. I've made tests with > the following code: > > --8<---------------cut here---------------start------------->8--- > (defun sha1-test (filename size) > (with-temp-buffer > (insert-file-contents-literally filename nil 0 size) > (sha1 (current-buffer)))) > > ;; From 1KiB to 64KiB > (list > (benchmark-run-compiled 1000 > (sha1-test "/tmp/a-5MiB-photo.jpg" (expt 2 10))) > (benchmark-run-compiled 1000 > (sha1-test "/tmp/a-5MiB-photo.jpg" (expt 2 11))) > (benchmark-run-compiled 1000 > (sha1-test "/tmp/a-5MiB-photo.jpg" (expt 2 12))) > (benchmark-run-compiled 1000 > (sha1-test "/tmp/a-5MiB-photo.jpg" (expt 2 13))) > (benchmark-run-compiled 1000 > (sha1-test "/tmp/a-5MiB-photo.jpg" (expt 2 14))) > (benchmark-run-compiled 1000 > (sha1-test "/tmp/a-5MiB-photo.jpg" (expt 2 15))) > (benchmark-run-compiled 1000 > (sha1-test "/tmp/a-5MiB-photo.jpg" (expt 2 16)))) > --8<---------------cut here---------------end--------------->8--- > > And here are the results on my machine: > ((0.664336771 1 0.14466495299998883) > (0.707937024 2 0.28811983400001395) > (0.940229304 3 0.44037704100000497) ;; <- 4KiB > (1.672118528 4 0.7672738199999856) > (2.6194289370000003 6 1.046699996000001) > (3.169999951 11 1.5916382949999957) > (6.547043287 21 3.195145416999992)) > > So this 4KiB seems practical: about 1 second for one thousand run. > WDYT? I only commented on that because you said it allows you to use a single directory. Otherwise, I have no problems with using just 4KiB. From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 11 17:33:28 2023 Received: (at 61394) by debbugs.gnu.org; 11 Feb 2023 22:33:28 +0000 Received: from localhost ([127.0.0.1]:43505 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pQyQy-00068b-Da for submit@debbugs.gnu.org; Sat, 11 Feb 2023 17:33:28 -0500 Received: from ledu-giraud.fr ([51.159.28.247]:30854) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pQyQs-00068M-Dx for 61394@debbugs.gnu.org; Sat, 11 Feb 2023 17:33:26 -0500 DKIM-Signature: v=1; a=ed25519-sha256; c=simple/simple; s=ed25519; bh=TjkwW8my qsPdtHqs7IleXQdSawKiggDtkPkMS91il0Q=; h=date:references:in-reply-to: subject:cc:to:from; d=ledu-giraud.fr; b=7TVZ45HVgf8gaQG6fCNv3aBn7DGLye mQxzQtSVii2l7WSu77leOvYrSgDnMMAGfGONVU6h5qkjUOtCHiU9jYDQ== DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=TjkwW8myqsPdtHqs 7IleXQdSawKiggDtkPkMS91il0Q=; h=date:references:in-reply-to:subject: cc:to:from; d=ledu-giraud.fr; b=0a2S6kFX4xQevZoYcfjpG2qH/FoW5Zj5eZmsDo DOjLek0RlI7wj0JhT8bAf3/2rc9yIoM7/lx/WgqaAy9JIJf9lHBwZNRJzmuryYlp+zW45l 7YMkdbCds/D9D2m7DGaDWGE+GV2rIqIzyYr08sQGvT29k/hZ1WM1YZ2s+rSByfYd/J2MXu rZotDBiFAiMf10Xa3XHslj/G8Zfo4/ZBiHVN5LZKYfUFGi8eRpavQzZhxlPtvnlsgMv7Oq RlilXM/6wi6W43WVNoNY+JcCeuXlTk4BA1rgQa5uNYeG6hatr3TUhqZIfkvERtUws6iHbt zM3HIRH9DrtRWe/UN2RSKE6g== Received: from computer ( [10.1.1.1]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id bc50b16b (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Sat, 11 Feb 2023 23:33:21 +0100 (CET) From: Manuel Giraud To: Eli Zaretskii Subject: Re: bug#61394: 30.0.50; [PATCH] Image-dired thumb name based on content In-Reply-To: <838rh4jlsq.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 11 Feb 2023 16:53:25 +0200") References: <874jruy7xx.fsf@ledu-giraud.fr> <87ttztk0yw.fsf@tcd.ie> <87v8k9s6j9.fsf@ledu-giraud.fr> <83ilg8jzti.fsf@gnu.org> <87k00oo03r.fsf@ledu-giraud.fr> <838rh4jlsq.fsf@gnu.org> Date: Sat, 11 Feb 2023 23:33:19 +0100 Message-ID: <87fsbboms0.fsf@ledu-giraud.fr> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 61394 Cc: contovob@tcd.ie, 61394@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: [...] > I only commented on that because you said it allows you to use a > single directory. Otherwise, I have no problems with using just 4KiB. A single directory is already what is used now when image-dired-thumbnail-storage is set to 'image-dired (the default). Only the SHA-1 is taken from the file path. I'll fix my patch with your suggestions then. -- Manuel Giraud From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 11 18:06:37 2023 Received: (at 61394) by debbugs.gnu.org; 11 Feb 2023 23:06:37 +0000 Received: from localhost ([127.0.0.1]:43514 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pQyx3-0006zY-3x for submit@debbugs.gnu.org; Sat, 11 Feb 2023 18:06:37 -0500 Received: from ledu-giraud.fr ([51.159.28.247]:36560) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pQyx0-0006zN-NZ for 61394@debbugs.gnu.org; Sat, 11 Feb 2023 18:06:36 -0500 DKIM-Signature: v=1; a=ed25519-sha256; c=simple/simple; s=ed25519; bh=sGGHyHWd 9782RrFU5s8kjQqFsiYeH2pBAqMaAi2bHZg=; h=date:references:in-reply-to: subject:cc:to:from; d=ledu-giraud.fr; b=gy6nMxOjxF2XiaRVSb9QLMYas1KEaF xOw1CLQOURPvdECAPlbppn79fhLXIZupyrFi6Od+1bpixh0++Hnc1wCA== DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=sGGHyHWd9782RrFU 5s8kjQqFsiYeH2pBAqMaAi2bHZg=; h=date:references:in-reply-to:subject: cc:to:from; d=ledu-giraud.fr; b=KL+z2E7XGgKzq8Ip4Df8K/5WtSH3XSouGZOsQG s9t/7n5sk5WujzT1x/HWiLFxRTTA5xhLAdu3GKA+5tdC4VyNnLI1icfn7LQQaLxHaTUG97 Xt6IFIhIQB3iyVM2t1yuXZBRXLA9adLp0dX2Wnbq4BuVlgUxCoxW9xGZRkasEE2lYiSOxP i46UIqphWe1ZXL6swI9GQ0mXHv53r/SSkroBoyI7tYV4vfPR8xrtIG64JVW9P9VhNrkpct Lc9hIajm7hhPLKk1q9dQYBOBwri86ax4B5PymZfnEcblDSVcdUdgn1cqXa2fuEqS7QvVxb +tG2C5G3fkiEhGLTPO6lu+aQ== Received: from computer ( [10.1.1.1]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id c96d3c4e (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Sun, 12 Feb 2023 00:06:33 +0100 (CET) From: Manuel Giraud To: Eli Zaretskii Subject: Re: bug#61394: 30.0.50; [PATCH] Image-dired thumb name based on content In-Reply-To: <838rh4jlsq.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 11 Feb 2023 16:53:25 +0200") References: <874jruy7xx.fsf@ledu-giraud.fr> <87ttztk0yw.fsf@tcd.ie> <87v8k9s6j9.fsf@ledu-giraud.fr> <83ilg8jzti.fsf@gnu.org> <87k00oo03r.fsf@ledu-giraud.fr> <838rh4jlsq.fsf@gnu.org> Date: Sun, 12 Feb 2023 00:06:32 +0100 Message-ID: <87bklzol8n.fsf@ledu-giraud.fr> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 61394 Cc: contovob@tcd.ie, 61394@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain So, here is another version of the patch. I'm not quite sure for the docstring of image-dired-thumb-name. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Image-dired-thumb-name-based-on-contents.patch >From 5cf749b1b321c5f1bd80ae4bb3e1dcf2ba5c02e1 Mon Sep 17 00:00:00 2001 From: Manuel Giraud Date: Thu, 9 Feb 2023 19:56:37 +0100 Subject: [PATCH] Image-dired thumb name based on contents * lisp/image/image-dired-util.el (image-dired-contents-sha1): New utility that compute the SHA-1 of the first 4KiB of the contents of a file. (image-dired-thumb-name): Fix the docstring and use image-dired-contents-sha1. --- lisp/image/image-dired-util.el | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/lisp/image/image-dired-util.el b/lisp/image/image-dired-util.el index c03f9d2e3d3..cde9d0be8d8 100644 --- a/lisp/image/image-dired-util.el +++ b/lisp/image/image-dired-util.el @@ -57,18 +57,31 @@ image-dired-dir (message "Thumbnail directory created: %s" image-dired-dir)) image-dired-dir)) +(defun image-dired-contents-sha1 (filename) + "Compute the SHA-1 of the first 4KiB of FILENAME's contents." + (with-temp-buffer + (insert-file-contents-literally filename nil 0 4096) + (sha1 (current-buffer)))) + (defun image-dired-thumb-name (file) "Return absolute file name for thumbnail FILE. Depending on the value of `image-dired-thumbnail-storage', the file name of the thumbnail will vary: -- For `use-image-dired-dir', make a SHA1-hash of the image file's - directory name and add that to make the thumbnail file name - unique. -- For `per-directory' storage, just add a subdirectory. + +- For `image-dired', make a SHA1-hash the contents of the image + FILE with `image-dired-contents-sha1' and append a \".jpg\" + extension. This thumbnail will be stored in the + `image-dired-dir' directory. + +- For `per-directory', append a \".thumb.jpg\" extension to the + FILE's name. This thumbnail will be stored in a + \".image-dired\" subdirectory into the FILE's directory. + - For `standard' storage, produce the file name according to the Thumbnail Managing Standard. Among other things, an MD5-hash of the image file's directory name will be added to the filename. + See also `image-dired-thumbnail-storage'." (let ((file (expand-file-name file))) (cond ((memq image-dired-thumbnail-storage @@ -85,7 +98,7 @@ image-dired-thumb-name ((or (eq 'image-dired image-dired-thumbnail-storage) ;; Maintained for backwards compatibility: (eq 'use-image-dired-dir image-dired-thumbnail-storage)) - (expand-file-name (format "%s.jpg" (sha1 file)) + (expand-file-name (format "%s.jpg" (image-dired-contents-sha1 file)) (image-dired-dir))) ((eq 'per-directory image-dired-thumbnail-storage) (expand-file-name (format "%s.thumb.jpg" -- 2.39.1 --=-=-= Content-Type: text/plain -- Manuel Giraud --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 11 22:02:37 2023 Received: (at 61394) by debbugs.gnu.org; 12 Feb 2023 03:02:37 +0000 Received: from localhost ([127.0.0.1]:43684 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pR2dQ-00070w-Qu for submit@debbugs.gnu.org; Sat, 11 Feb 2023 22:02:37 -0500 Received: from mail-oi1-f176.google.com ([209.85.167.176]:40725) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pR2dL-00070g-Eg for 61394@debbugs.gnu.org; Sat, 11 Feb 2023 22:02:34 -0500 Received: by mail-oi1-f176.google.com with SMTP id n132so7700348oih.7 for <61394@debbugs.gnu.org>; Sat, 11 Feb 2023 19:02:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=t6zS3lPON8mud2BPv4cdksXTPlaRO35RSZxLAvWtrXg=; b=a7n1aJm7V/6CsG32zWCItfEVdSP1AHmiluLeSeNQJPa8MUeARU6LrhdYb31qztEVZe I/dxVjm3v+uXwt/pP12V6OE1XYE9EQv2+WIhldP/iet2VGmLgTylHly9RUHWZxcGIp0U 4oyZQQt96uDxHaVlqHcyrqe4qRG1Td/eUFq04++KesBdfh5DpPOOL00M1icKcMKLgDjU q6GkG0aNCDBA9LZye4WHvDu5mzL3yGDzALT4mGS4gV9smc6+Y4S3btksvvMQoS54pqID z01UF0waroYt2C7daf3/nu4NY5AkHTkdSIzH/VcxZvWyqKWRdbkSzVW6yF6I2HESY97W BWoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=t6zS3lPON8mud2BPv4cdksXTPlaRO35RSZxLAvWtrXg=; b=dfy7EXWzH73MQvFqElItzYxmWvsVUrFtIYi8I/VRoGqCjTMxroYcCVFWcy1gATLBAZ vDvVu9IpXdhvml/98eXyYsEW1AVHS+BEBPOIAGJ+p7c5X8ZSEzx4Zh1BWP4oXZUcCCYZ XTuVpIWVhRPHAdGYolGfMb1jMHJGKdRwndsP5oQfQEYfulRY4fuzvaSL0vwVzvXgQqhR d+BN07MKU5JluUh1D9UuJNmg/UWoqLEGI9urAx6gNbdlyvjC564L7mWWvzwg2TZUHMpk tOF8qwMKpC4RKCimLE4cYWaewAJVfnm3qLLjU7zatZo30n+JVfvnESk7KYNIXdlBc3UE YBGg== X-Gm-Message-State: AO0yUKWSbKxM6n0ACMvIf+fp53xUgVE9eNUoV6eBx2pBIEQZKcJVPjIm wRhqfdwzAZSVBYT2Wm5V3sYVrV7qcNbH8a0APpw= X-Google-Smtp-Source: AK7set8mLRN9j1JUcd0JxM82JTWDsoTWxDjC4lHdqsac+J0bAM2vFAXtifvNUjlaQklxYUGtk2SgrB7wYgo2kC1iCm0= X-Received: by 2002:a05:6808:2116:b0:360:ceaa:7e4e with SMTP id r22-20020a056808211600b00360ceaa7e4emr1302716oiw.199.1676170945911; Sat, 11 Feb 2023 19:02:25 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sun, 12 Feb 2023 03:02:25 +0000 From: Stefan Kangas In-Reply-To: <87bklzol8n.fsf@ledu-giraud.fr> References: <874jruy7xx.fsf@ledu-giraud.fr> <87ttztk0yw.fsf@tcd.ie> <87v8k9s6j9.fsf@ledu-giraud.fr> <83ilg8jzti.fsf@gnu.org> <87k00oo03r.fsf@ledu-giraud.fr> <838rh4jlsq.fsf@gnu.org> <87bklzol8n.fsf@ledu-giraud.fr> X-Hashcash: 1:20:230212:61394@debbugs.gnu.org::RYWW6yZySEx8zfSy:7b5I MIME-Version: 1.0 Date: Sun, 12 Feb 2023 03:02:25 +0000 Message-ID: Subject: Re: bug#61394: 30.0.50; [PATCH] Image-dired thumb name based on content To: Manuel Giraud , Eli Zaretskii Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61394 Cc: contovob@tcd.ie, 61394@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Manuel Giraud via "Bug reports for GNU Emacs, the Swiss army knife of text editors" writes: > So, here is another version of the patch. What is the performance impact of this? Could we see some benchmarks? I routinely open folders with hundreds of files that are several megabytes each, so I think this is the type of benchmark I would be interested in. This is common when working with images from a digital camera. If it has too much of a performance impact, we could consider making it optional (and disable it by default). From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 12 16:53:45 2023 Received: (at 61394) by debbugs.gnu.org; 12 Feb 2023 21:53:45 +0000 Received: from localhost ([127.0.0.1]:47087 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRKI5-0006QT-7k for submit@debbugs.gnu.org; Sun, 12 Feb 2023 16:53:45 -0500 Received: from ledu-giraud.fr ([51.159.28.247]:15689) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRKI3-0006QJ-34 for 61394@debbugs.gnu.org; Sun, 12 Feb 2023 16:53:44 -0500 DKIM-Signature: v=1; a=ed25519-sha256; c=simple/simple; s=ed25519; bh=Fv5MO1cG WNh5JhzjrKooY/j5RyMThVXmir3qA/3iR2c=; h=date:references:in-reply-to: subject:cc:to:from; d=ledu-giraud.fr; b=vEa2GEgh4S0dNr8JIdL7OkVgxdeoUt KB9nKY/JA/xxaF6zn9atzYSsFU7t5ulWwcgsnGa3DYHqBLDxn9gL4FAw== DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=Fv5MO1cGWNh5Jhzj rKooY/j5RyMThVXmir3qA/3iR2c=; h=date:references:in-reply-to:subject: cc:to:from; d=ledu-giraud.fr; b=DA0z9YVSTFNRfDfhKGZjcrEAzqFh0I9RKQfWLd C3PIu0GC4AfL5y3ZfXxjXA448iaDYv4YFGzxMzDw940+W+tgjoWg9VI+UpDMKrkTbPIGKK yjV9Ovwv/6lFRSddq7DrJtqiwKCGpOLZ8Rp8FzgDdIxnBVrta0d6+30l7CA6pwO64BHJs+ fT7DlGuky39xdJNZKolWwjin67Q0/7VUIlXVVeaNm7R31dLgc9nLMMaRiGEHItbNX4icsY FBbYC9vVBMgFJF3MF5M8jVcoEZdLQ1lxtDeHONbQ4UdcSSxkK6ui/ex89pafTMBcufr6FS NvZ+1MLYoVkzPq4nEeaaB5bg== Received: from computer ( [10.1.1.1]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id a8fc65d6 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Sun, 12 Feb 2023 22:53:41 +0100 (CET) From: Manuel Giraud To: Stefan Kangas Subject: Re: bug#61394: 30.0.50; [PATCH] Image-dired thumb name based on content In-Reply-To: (Stefan Kangas's message of "Sun, 12 Feb 2023 03:02:25 +0000") References: <874jruy7xx.fsf@ledu-giraud.fr> <87ttztk0yw.fsf@tcd.ie> <87v8k9s6j9.fsf@ledu-giraud.fr> <83ilg8jzti.fsf@gnu.org> <87k00oo03r.fsf@ledu-giraud.fr> <838rh4jlsq.fsf@gnu.org> <87bklzol8n.fsf@ledu-giraud.fr> Date: Sun, 12 Feb 2023 22:53:40 +0100 Message-ID: <877cwmo8ij.fsf@ledu-giraud.fr> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 61394 Cc: contovob@tcd.ie, Eli Zaretskii , 61394@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Stefan Kangas writes: > Manuel Giraud via "Bug reports for GNU Emacs, the Swiss army knife of > text editors" writes: > >> So, here is another version of the patch. > > What is the performance impact of this? Could we see some benchmarks? The performance impact is important. Here are the results from a list of images of mine: --8<---------------cut here---------------start------------->8--- (length *images*) -> 3664 (benchmark-run-compiled 10 (dolist (im *images*) (sha1 im))) -> (0.367976492 1 0.2809483390000196) (benchmark-run-compiled 10 (dolist (im *images*) (image-dired-contents-sha1 im))) -> (72.115512605 84 26.079076938000014) --8<---------------cut here---------------end--------------->8--- OTOH, using image-dired on a directory of 245 photos before and after this patch I cannot feel any difference (after the thumbnails are done of course). > I routinely open folders with hundreds of files that are several > megabytes each, so I think this is the type of benchmark I would be > interested in. This is common when working with images from a digital > camera. > > If it has too much of a performance impact, we could consider making it > optional (and disable it by default). Maybe we could have this in another option for `image-dired-thumbnail-storage'? What do you think of 'image-dired-contents? -- Manuel Giraud From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 15 09:19:12 2023 Received: (at 61394) by debbugs.gnu.org; 15 Feb 2023 14:19:12 +0000 Received: from localhost ([127.0.0.1]:58348 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSIcp-0004Yb-Ti for submit@debbugs.gnu.org; Wed, 15 Feb 2023 09:19:12 -0500 Received: from mail-oa1-f54.google.com ([209.85.160.54]:45700) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSIcn-0004YL-GZ for 61394@debbugs.gnu.org; Wed, 15 Feb 2023 09:19:10 -0500 Received: by mail-oa1-f54.google.com with SMTP id 586e51a60fabf-16cc1e43244so18791855fac.12 for <61394@debbugs.gnu.org>; Wed, 15 Feb 2023 06:19:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=PWwIQOjNP3CL3cpQycqVVIAIi9yH0kXr5SbwleScJWQ=; b=Lw7LunRUNPNoBxBhb5wPa+ije54E7EVhnbOHh8u2K1gz/hRm6bTHa/1N71MxGhp6S6 5wy45JZKONtEttfvAHtLATuWweipQGHd0y0ohPZboInGDWKqgLSJBtwZS3PyZFpRDBwZ SE2kDk2xmazF5XzJFFxjELgSg92yUig3qOSN+zkMbTv8eX0lTocOWO80+qx3aj8fPh9+ 5myPyPsTepalLBPbJfguHIwKMRY5ruAZMcm9Rs1zEr0GgIW0uIhHFz/FdOSrmcf6Ewgy obeKWJRl4907YGpJrbjuBVezZ0I0foQjmMJijqrUHTitdwis3ZodtUL2hqjqzYmUfo3n jh4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=PWwIQOjNP3CL3cpQycqVVIAIi9yH0kXr5SbwleScJWQ=; b=CLHkc+kknJfrVXLerb7CbWZn66FXjgkoCDz+Xlj7XbtHiVgkvALTLExHuw7+/ye8Db N8voVEBvu6tgpbEW2/nAEvbYd6z8AMTbajDxy1k+alqjEUkmuqJjDdQT9Q2Pzkf6r3N9 42da39eKDLS/mlQ41hZz0VfbaSH736TPVLMlROEND/VRmKuZzu3ztOHon0fP9pZDLGI2 7n+Fehwmy2kwIkjw7TQmXsvYfTycZFYesrtFzPe1XeFn6nY/Tk8P/UWEWpRzEtttDDV0 SG6jwKgPJzMy+8cbd8cCwSq0Qrywyix6/ZBvnkbmmnBqURABVsqfGCB5bu/qs76WdeDr I7gg== X-Gm-Message-State: AO0yUKXhNfmmNEcSzLew03JdL22K3K3XR0gBb3W1zRF5IWWRjCuhm2gd cj/n3EH1EPwEzDS8dYAlBZGpHTBDggJYNTTjB+U= X-Google-Smtp-Source: AK7set9X0pHuM/Hk8JpnwFBC8xryW5/hrN7yX3iGeAG+Ezl1X2O79TD1hxXzomgklakKFdRgF1Y4D1Uu+gxoDEQTHG4= X-Received: by 2002:a05:6870:6112:b0:16e:6ff:760d with SMTP id s18-20020a056870611200b0016e06ff760dmr255688oae.291.1676470743765; Wed, 15 Feb 2023 06:19:03 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Wed, 15 Feb 2023 06:19:02 -0800 From: Stefan Kangas In-Reply-To: <877cwmo8ij.fsf@ledu-giraud.fr> References: <874jruy7xx.fsf@ledu-giraud.fr> <87ttztk0yw.fsf@tcd.ie> <87v8k9s6j9.fsf@ledu-giraud.fr> <83ilg8jzti.fsf@gnu.org> <87k00oo03r.fsf@ledu-giraud.fr> <838rh4jlsq.fsf@gnu.org> <87bklzol8n.fsf@ledu-giraud.fr> <877cwmo8ij.fsf@ledu-giraud.fr> X-Hashcash: 1:20:230215:61394@debbugs.gnu.org::T9cBZDR885F9G0kP:3uey MIME-Version: 1.0 Date: Wed, 15 Feb 2023 06:19:02 -0800 Message-ID: Subject: Re: bug#61394: 30.0.50; [PATCH] Image-dired thumb name based on content To: Manuel Giraud Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61394 Cc: contovob@tcd.ie, Eli Zaretskii , 61394@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Manuel Giraud writes: > The performance impact is important. Here are the results from a list > of images of mine: > --8<---------------cut here---------------start------------->8--- > (length *images*) -> 3664 > > (benchmark-run-compiled 10 (dolist (im *images*) (sha1 im))) > -> (0.367976492 1 0.2809483390000196) > > (benchmark-run-compiled 10 (dolist (im *images*) (image-dired-contents-sha1 im))) > -> (72.115512605 84 26.079076938000014) > --8<---------------cut here---------------end--------------->8--- Thanks. That's a slowdown by a factor close to 100, so while I think the feature sounds useful, it should indeed be made optional. > Maybe we could have this in another option for > `image-dired-thumbnail-storage'? I think 'image-dired-thumbnail-storage' is already complicated enough, and I'd rather not complicate it further. > What do you think of 'image-dired-contents? Hmm, it sounds a bit too nondescript. How about something like 'image-dired-thumbnail-naming'? From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 15 10:36:11 2023 Received: (at 61394) by debbugs.gnu.org; 15 Feb 2023 15:36:11 +0000 Received: from localhost ([127.0.0.1]:33652 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSJpH-0007Vx-8X for submit@debbugs.gnu.org; Wed, 15 Feb 2023 10:36:11 -0500 Received: from ledu-giraud.fr ([51.159.28.247]:5968) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSJpA-0007VT-T1 for 61394@debbugs.gnu.org; Wed, 15 Feb 2023 10:36:05 -0500 DKIM-Signature: v=1; a=ed25519-sha256; c=simple/simple; s=ed25519; bh=hohpumwB RKr/3rFr7LetrvkilYmkXEeX38oZANPMlBM=; h=date:references:in-reply-to: subject:cc:to:from; d=ledu-giraud.fr; b=LTNXCquMgB8PKXxg0uf7wZ3kSLU1NL 2cbffh6p8JsiHkA1CZ/wFAdm9CGNl4dFLXBfbXgqKmFJeWfL1fxuZKBg== DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=hohpumwBRKr/3rFr 7LetrvkilYmkXEeX38oZANPMlBM=; h=date:references:in-reply-to:subject: cc:to:from; d=ledu-giraud.fr; b=PqIIVoyY9/0L4lFGC2nd4gBcKpeCrAV09Ioq7Z 4F20tWJvWCKY16mr4RPFV5AkoRR1mnv4WTjb6NNvjerH1+4jQBFPAor13JPxKc9n2ey5mw /po7Jx7qQZk1VNmJlxAPx41HjbT3PPUEt8Y1koZOvUjpT3mVP/TQqWx1Z8NdQxkjqgyD6c GqOnzyEBao4ZgZ1wSmBo7iZ1wqKe7Rfneo1np42Tj6CqzRNqpmpRNqYMR7dVYtTJloIlSc Wc4m620GFNIgI3BqPkF3yxF3sOXGZ1kT53mY+eq3Kc+kaO1zHGnjBFITkwvmLLuSbizP83 E17eChGmSl84Zvb9CLlr4dtA== Received: from computer ( [10.1.1.1]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id 0bee5077 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 15 Feb 2023 16:35:59 +0100 (CET) From: Manuel Giraud To: Stefan Kangas Subject: Re: bug#61394: 30.0.50; [PATCH] Image-dired thumb name based on content In-Reply-To: (Stefan Kangas's message of "Wed, 15 Feb 2023 06:19:02 -0800") References: <874jruy7xx.fsf@ledu-giraud.fr> <87ttztk0yw.fsf@tcd.ie> <87v8k9s6j9.fsf@ledu-giraud.fr> <83ilg8jzti.fsf@gnu.org> <87k00oo03r.fsf@ledu-giraud.fr> <838rh4jlsq.fsf@gnu.org> <87bklzol8n.fsf@ledu-giraud.fr> <877cwmo8ij.fsf@ledu-giraud.fr> Date: Wed, 15 Feb 2023 16:35:56 +0100 Message-ID: <87y1oz54bn.fsf@ledu-giraud.fr> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 61394 Cc: contovob@tcd.ie, Eli Zaretskii , 61394@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Stefan Kangas writes: [...] > Thanks. That's a slowdown by a factor close to 100, so while I think > the feature sounds useful, it should indeed be made optional. I'm ok with that. >> Maybe we could have this in another option for >> `image-dired-thumbnail-storage'? > > I think 'image-dired-thumbnail-storage' is already complicated enough, > and I'd rather not complicate it further. I don't understand here. Do you suggest introducing another custom/variable? 'image-dired-thumbnail-storage' has currently only 3 possible values. I was suggesting adding one more. >> What do you think of 'image-dired-contents? > > Hmm, it sounds a bit too nondescript. How about something like > 'image-dired-thumbnail-naming'? Do you mean as a name for a new variable? (I was talking about a new possible value for image-dired-thumbnail-storage) -- Manuel Giraud From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 19 09:06:26 2023 Received: (at 61394) by debbugs.gnu.org; 19 Feb 2023 14:06:26 +0000 Received: from localhost ([127.0.0.1]:46000 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pTkKg-0007cl-7d for submit@debbugs.gnu.org; Sun, 19 Feb 2023 09:06:26 -0500 Received: from mail-oi1-f174.google.com ([209.85.167.174]:39679) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pTkKe-0007cT-S0 for 61394@debbugs.gnu.org; Sun, 19 Feb 2023 09:06:25 -0500 Received: by mail-oi1-f174.google.com with SMTP id bb36so752340oib.6 for <61394@debbugs.gnu.org>; Sun, 19 Feb 2023 06:06:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=pSc+WiItBCBQXx0at/aBSqLvEy630lKiagAHPOKr3Rc=; b=C+nQ5tcCMI6bQEHBU1vwT2o1iKA017I7B7jOQes8brMyJemLrEXnaLVy1ViZiVPhyY Nh03lN7cH1UpHXf7h9ZsYkCUp0mGxVeukZNN5bZQ6fiUHq4UYcaQuMsi3BB21ZxkdbNw bmKZK3uF/4ozluync/JhO6M4vgASOoTfOrSTR+yy/M6Pbstf3Pkg5BvT6aNQY/1/kW1T qvTLfgbeWaSf5nRLfZuyEgDCwBZ6L6iQ9RxrabWVOEKKSDFOVobBga4Onyam96igH8Po Jq0mMMlPZgPxWa+jm8GzGONB6SKp1cvNsspB5eDSXdVWfPExdevxpUMtB3M+aiLosZcU QEPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=pSc+WiItBCBQXx0at/aBSqLvEy630lKiagAHPOKr3Rc=; b=OWKQTRK2/wa5eGyive+TVY6rXTKxAtEbZmexJ7YssT+LEC4RNkYBDz84RKoCeC7cMv 502AeeIr/BFvsTLO8AFfc+UMajkEMV3Scl032v5DUOBV7JcwhktsFm+A6A1HYq7CA30d FjX40/9niil1i3LGnwS0CjQ6gFZlNVtz/Rjes0pycG1n+QfRMDBYXLvZuAbH1d1nyeVW b0wXi7IsSvMxDyVkNzg/G3ug2z8Q5nY8Cb23WRfSsv9UsPpBoRXvcYG3s/P/Gr3zvTDU LzvDJfyXLfWMGU4rkVvP6IzST5YBMSIWcd0OaLeFl1bd7xzDIsjaKKeLM4cSGOnVDO1Z 7eIg== X-Gm-Message-State: AO0yUKUMoEeMLTohZopLqhRJlJ1VQnFD9hVfVa9KVyeUTH7GZ4fnh4UT 3udoZqSi7p4798WgGpB8A5v8gz71eWDaLjk8hf8= X-Google-Smtp-Source: AK7set+HGbZvmvcgXsbTGw7504WSVDlQ5zwvlftRkeIGsoCQNEAEp+dcS8E1uGlcm5N/s0oDpd39tB/LJGF9nkdeYdQ= X-Received: by 2002:a05:6808:11c5:b0:378:3f53:9e8 with SMTP id p5-20020a05680811c500b003783f5309e8mr1063394oiv.291.1676815579274; Sun, 19 Feb 2023 06:06:19 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sun, 19 Feb 2023 06:06:18 -0800 From: Stefan Kangas In-Reply-To: <87y1oz54bn.fsf@ledu-giraud.fr> References: <874jruy7xx.fsf@ledu-giraud.fr> <87ttztk0yw.fsf@tcd.ie> <87v8k9s6j9.fsf@ledu-giraud.fr> <83ilg8jzti.fsf@gnu.org> <87k00oo03r.fsf@ledu-giraud.fr> <838rh4jlsq.fsf@gnu.org> <87bklzol8n.fsf@ledu-giraud.fr> <877cwmo8ij.fsf@ledu-giraud.fr> <87y1oz54bn.fsf@ledu-giraud.fr> X-Hashcash: 1:20:230219:61394@debbugs.gnu.org::XeJUIcWynD0FQP/o:3zKi MIME-Version: 1.0 Date: Sun, 19 Feb 2023 06:06:18 -0800 Message-ID: Subject: Re: bug#61394: 30.0.50; [PATCH] Image-dired thumb name based on content To: Manuel Giraud Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61394 Cc: contovob@tcd.ie, Eli Zaretskii , 61394@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Manuel Giraud writes: >> I think 'image-dired-thumbnail-storage' is already complicated enough, >> and I'd rather not complicate it further. > > I don't understand here. Do you suggest introducing another > custom/variable? 'image-dired-thumbnail-storage' has currently only 3 > possible values. I was suggesting adding one more. That variable relates to *where* to store the thumbnail files, not how to name the thumbnail files. I might want to use `image-dired' or `per-directory' using either thumbnail naming scheme. So a new variable makes more sense, as it is orthogonal from `image-dired-thumbnail-storage'. >> Hmm, it sounds a bit too nondescript. How about something like >> 'image-dired-thumbnail-naming'? > > Do you mean as a name for a new variable? (I was talking about a new > possible value for image-dired-thumbnail-storage) Yes. However, we currently have `image-dired-thumb-size', so perhaps `image-dired-thumb-naming' is better. From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 19 09:43:32 2023 Received: (at 61394) by debbugs.gnu.org; 19 Feb 2023 14:43:32 +0000 Received: from localhost ([127.0.0.1]:46018 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pTkua-0000Q4-3K for submit@debbugs.gnu.org; Sun, 19 Feb 2023 09:43:32 -0500 Received: from ledu-giraud.fr ([51.159.28.247]:24306) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pTkuX-0000Ps-7y for 61394@debbugs.gnu.org; Sun, 19 Feb 2023 09:43:30 -0500 DKIM-Signature: v=1; a=ed25519-sha256; c=simple/simple; s=ed25519; bh=nSs3qRzh mJ2DaCxNDxrI9vcUAd5J2C3HRsnZmYKtO7w=; h=date:references:in-reply-to: subject:cc:to:from; d=ledu-giraud.fr; b=tBJUGN5ghBY8yzLRYOyBoLEHZKCSgF UoEJaKLIwFXySKz2Aye0rBxcfxF68nRa8+OhpwB9Hw1lAxCHRv0pB0BQ== DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=nSs3qRzhmJ2DaCxN DxrI9vcUAd5J2C3HRsnZmYKtO7w=; h=date:references:in-reply-to:subject: cc:to:from; d=ledu-giraud.fr; b=nCvx39eYR0kSK6pv5sKV6mpGkQAXJlodWoafJM /yn3TV4iyb6FTbTYtc4/31Nt0rxE0fumOCjq7VopLEwIvOEeei/j9ON0bLMUDm5XHuygxb A1RQ2l9xTZ2uwQckoOLgVsFop0MU3y79N02s2anPZy5WVehoDR8qtbqW1IGjwrtsLSE7VD x4gDnNUsB5g2xoUFTWrHsDo+MPh9W65rt0h4jEH7IvumlBv3FGyduXpsKlSb2xSeZPBrEL 73pNNqBSCY1fudZ+f9HMLuvtp7GQBrR18h/HxzAjbSoMyuLWAYfh5BRvGZDlrGXD8UQe4j bFCM6OGYvhrMiQXFc4rfW79Q== Received: from computer ( [10.1.1.1]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id 1e1ca988 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Sun, 19 Feb 2023 15:43:27 +0100 (CET) From: Manuel Giraud To: Stefan Kangas Subject: Re: bug#61394: 30.0.50; [PATCH] Image-dired thumb name based on content In-Reply-To: (Stefan Kangas's message of "Sun, 19 Feb 2023 06:06:18 -0800") References: <874jruy7xx.fsf@ledu-giraud.fr> <87ttztk0yw.fsf@tcd.ie> <87v8k9s6j9.fsf@ledu-giraud.fr> <83ilg8jzti.fsf@gnu.org> <87k00oo03r.fsf@ledu-giraud.fr> <838rh4jlsq.fsf@gnu.org> <87bklzol8n.fsf@ledu-giraud.fr> <877cwmo8ij.fsf@ledu-giraud.fr> <87y1oz54bn.fsf@ledu-giraud.fr> Date: Sun, 19 Feb 2023 15:43:26 +0100 Message-ID: <87wn4dra0h.fsf@ledu-giraud.fr> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 61394 Cc: contovob@tcd.ie, Eli Zaretskii , 61394@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Stefan Kangas writes: > Manuel Giraud writes: > >>> I think 'image-dired-thumbnail-storage' is already complicated enough, >>> and I'd rather not complicate it further. >> >> I don't understand here. Do you suggest introducing another >> custom/variable? 'image-dired-thumbnail-storage' has currently only 3 >> possible values. I was suggesting adding one more. > > That variable relates to *where* to store the thumbnail files, not how > to name the thumbnail files. I might want to use `image-dired' or > `per-directory' using either thumbnail naming scheme. > > So a new variable makes more sense, as it is orthogonal from > `image-dired-thumbnail-storage'. > >>> Hmm, it sounds a bit too nondescript. How about something like >>> 'image-dired-thumbnail-naming'? >> >> Do you mean as a name for a new variable? (I was talking about a new >> possible value for image-dired-thumbnail-storage) > > Yes. However, we currently have `image-dired-thumb-size', so perhaps > `image-dired-thumb-naming' is better. Ok. I like that. I'll try to come up with something but I think I'll do some cleaning in the process as currently 'image-dired-thumbnail-storage' decides more than just the "where" (eg. add "thumb" somewhere). -- Manuel Giraud From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 19 11:19:33 2023 Received: (at 61394) by debbugs.gnu.org; 19 Feb 2023 16:19:33 +0000 Received: from localhost ([127.0.0.1]:49559 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pTmPV-00047T-D1 for submit@debbugs.gnu.org; Sun, 19 Feb 2023 11:19:33 -0500 Received: from mail-oa1-f41.google.com ([209.85.160.41]:35644) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pTmPS-00047E-9f for 61394@debbugs.gnu.org; Sun, 19 Feb 2023 11:19:32 -0500 Received: by mail-oa1-f41.google.com with SMTP id 586e51a60fabf-171d9ff4af8so936737fac.2 for <61394@debbugs.gnu.org>; Sun, 19 Feb 2023 08:19:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=T4JlbqheAWLHczjETrLY3fJpcba2VFgQ9zdtzDaJpSM=; b=R64Er4yyYsBl5CUcrjr8xikgYkos3KTyB/n1VpX9eI0Ssb3hRQ6wkV3BWDMqx9V/io yndiPSWfZRfnVY27vG2j4qv7MLDKPkthqlT8WhhC0pfQXvzdEhJlkJkS4BBzzwmgZQ04 zB5WBzvu9LvA47y+IIeO5B5y7qme95KE7wky6gfAdsmswENyMYHCh2rDmDbOhH7H2kG7 KIDFbF7Th2K6UsIn4T2ZnM4kLaDmdfgGQ7v8BV744MN2sKI6CFtJEUyhPHjgb4a2IRtE Yu0IHfy7UJ73S7sPRYp1+3rFlbX4mfg/hsj4+FtqSRaLcZzbO5GeuXJ3BbM2OQ8+OWiV dPnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=T4JlbqheAWLHczjETrLY3fJpcba2VFgQ9zdtzDaJpSM=; b=Uq1r5NXwb4nuaIe/K8pfPbMxkvjeec8q54gBf5cBq1ugo2sJao2kiSZcJoo2d7ajat Hd4aN15HkSaBA42ceJLthZrJcCDGMHzmr4Agvv29GdQLHV21u6U6xNAWwRuz5wrdmIFo 38BWZyqipQFyvxKUV97GJVRosT87Q9fA8Erygp7jozWAwif1ibxQtaeX2FX9ReE1paxv nQ1f33gAGQ4gCw/1730Rfqc87CLueriDxj34LRk72Denlll61aiGEl9MVge/rm1O3Mit FwME/g9J/KlWf0mp+GMRje4lz1XM9lqU5rwz+8JnSZWfny3aEX0SDhmi30i+yUOTFNHP DQdw== X-Gm-Message-State: AO0yUKXSR/rcmPpDjdR1Qvdcq+GbNVh0guQffoW1xbNvMDgt+3drBohf ybZvu2pZ3yGKi6NL/02TrD2uWjBuJiAPwcxX70o= X-Google-Smtp-Source: AK7set9qNRcAkt11D6kbfShffm4PLGNNIfzm+VwGeCUOn+BUH59ciqdLglvplkm49toTYFVj9XmgJ9V2LT1SF/mdPWo= X-Received: by 2002:a05:6870:968b:b0:16f:edf8:6210 with SMTP id o11-20020a056870968b00b0016fedf86210mr801713oaq.291.1676823564448; Sun, 19 Feb 2023 08:19:24 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sun, 19 Feb 2023 08:19:23 -0800 From: Stefan Kangas In-Reply-To: <87wn4dra0h.fsf@ledu-giraud.fr> References: <874jruy7xx.fsf@ledu-giraud.fr> <87ttztk0yw.fsf@tcd.ie> <87v8k9s6j9.fsf@ledu-giraud.fr> <83ilg8jzti.fsf@gnu.org> <87k00oo03r.fsf@ledu-giraud.fr> <838rh4jlsq.fsf@gnu.org> <87bklzol8n.fsf@ledu-giraud.fr> <877cwmo8ij.fsf@ledu-giraud.fr> <87y1oz54bn.fsf@ledu-giraud.fr> <87wn4dra0h.fsf@ledu-giraud.fr> X-Hashcash: 1:20:230219:61394@debbugs.gnu.org::wIkTSzfvw626CQSI:2Wp4 MIME-Version: 1.0 Date: Sun, 19 Feb 2023 08:19:23 -0800 Message-ID: Subject: Re: bug#61394: 30.0.50; [PATCH] Image-dired thumb name based on content To: Manuel Giraud Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61394 Cc: contovob@tcd.ie, Eli Zaretskii , 61394@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Manuel Giraud writes: > Ok. I like that. I'll try to come up with something but I think I'll > do some cleaning in the process as currently > 'image-dired-thumbnail-storage' decides more than just the "where" > (eg. add "thumb" somewhere). Sounds good, thanks. From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 20 04:20:27 2023 Received: (at 61394) by debbugs.gnu.org; 20 Feb 2023 09:20:27 +0000 Received: from localhost ([127.0.0.1]:50502 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pU2LT-0001kA-Gg for submit@debbugs.gnu.org; Mon, 20 Feb 2023 04:20:27 -0500 Received: from ledu-giraud.fr ([51.159.28.247]:24938) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pU2LQ-0001jy-7h for 61394@debbugs.gnu.org; Mon, 20 Feb 2023 04:20:26 -0500 DKIM-Signature: v=1; a=ed25519-sha256; c=simple/simple; s=ed25519; bh=U66Mv3Fl thhitKzfpBEQ1MMrnWnFlMqVUaqXMLUCn2s=; h=date:references:in-reply-to: subject:cc:to:from; d=ledu-giraud.fr; b=I5+GggBcEqJKOzSrIvrhJHNxC3qgfz znHI2mFTJx3Eo1KeooE40/6JFzV2rdlXg6Fmm5HXJ9icLUpPtJxyggDw== DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=U66Mv3FlthhitKzf pBEQ1MMrnWnFlMqVUaqXMLUCn2s=; h=date:references:in-reply-to:subject: cc:to:from; d=ledu-giraud.fr; b=qhTOzRJea5HX1sTlfkUXWT8/WUqAn05J3+oFkk 993sj/xuwraiUQ9B7hpDLVWo5QnlmXJo/tdPRkjQWm7i8Q2d7Ze5LzuWzDVIkPb+vmZspq ugD0yng3ULTKFr2EsQEuAi1rMe/iVCAYZDgNSEogmDal/ud2JIb+tfxrYDYC0CZB3dmw0M wvWCpOzyWwdpN+0nmtUiid2ROUxqp19qQy1j3Kta6IFzE+L3Lh0Ye7OT3wuyUv9XfqRpNR qLNrqEZZSQ5ZG2x0F5/QN/BOxOTRo2PeHt1y7GjAo5Zb85o8e3HQ1wqCkPHg5WfYmxAR17 mSPc6mw1jTFLq29pHCGAJrXg== Received: from computer ( [10.1.1.1]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id 8ab4ca45 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Mon, 20 Feb 2023 10:20:22 +0100 (CET) From: Manuel Giraud To: Stefan Kangas Subject: Re: bug#61394: 30.0.50; [PATCH] Image-dired thumb name based on content In-Reply-To: (Stefan Kangas's message of "Sun, 19 Feb 2023 08:19:23 -0800") References: <874jruy7xx.fsf@ledu-giraud.fr> <87ttztk0yw.fsf@tcd.ie> <87v8k9s6j9.fsf@ledu-giraud.fr> <83ilg8jzti.fsf@gnu.org> <87k00oo03r.fsf@ledu-giraud.fr> <838rh4jlsq.fsf@gnu.org> <87bklzol8n.fsf@ledu-giraud.fr> <877cwmo8ij.fsf@ledu-giraud.fr> <87y1oz54bn.fsf@ledu-giraud.fr> <87wn4dra0h.fsf@ledu-giraud.fr> Date: Mon, 20 Feb 2023 10:20:21 +0100 Message-ID: <87edqkvgkq.fsf@ledu-giraud.fr> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 61394 Cc: contovob@tcd.ie, Eli Zaretskii , 61394@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi, While at that, I see that for an `image-dired-thumbnail-storage' other than 'standard* the thumbnail name is hardcoded to "jpg" ("png" for 'standard* but it seems to be mandated by said standard). Should it stay that way or could we extract the extension from the image filename? -- Manuel Giraud From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 25 13:45:42 2023 Received: (at 61394) by debbugs.gnu.org; 25 Feb 2023 18:45:42 +0000 Received: from localhost ([127.0.0.1]:41390 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pVzYE-0007On-0I for submit@debbugs.gnu.org; Sat, 25 Feb 2023 13:45:42 -0500 Received: from ledu-giraud.fr ([51.159.28.247]:38097) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pVzYA-0007Oc-6q for 61394@debbugs.gnu.org; Sat, 25 Feb 2023 13:45:39 -0500 DKIM-Signature: v=1; a=ed25519-sha256; c=simple/simple; s=ed25519; bh=YHwHrwG7 3znnyeW/PIoQA2abBKV4eG43TrxIurz2NfM=; h=date:references:in-reply-to: subject:cc:to:from; d=ledu-giraud.fr; b=w5xXsZQTf2P82h7tJmkqqEaPWpXeiy WLB6pJdBSkuhYwlolscKsfKpwLzhwuEpIeZyUBGiY9bCb2eiSsALJ2CQ== DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=YHwHrwG73znnyeW/ PIoQA2abBKV4eG43TrxIurz2NfM=; h=date:references:in-reply-to:subject: cc:to:from; d=ledu-giraud.fr; b=wu3C0jCSyFUn/hZLd2TgprA1LKuSjAI4B9+GRM P30C6m9/V3R4bEnhqBsPbflJsBSEOnJl4CTdfGqSxGRUHKFxV968o+xijx6W71uHc/1paI u/u5D1QUzq2+1inT7ghNektMW8Fpr2UBgSa/LNp7dkFGvAqkKY6NTgezefb2hxMQUzqbNF Iy6LGidk0A1ch7dKaw/RCtFgZODlbyQ4piJJWpmXiPheTZ0SnOfvjtQFCvKxL8i/MTaRi7 DHW+ruiN2M4vj3/9hZHCGSoPKeJKyiNdKlH9TLhWixcSlvFlknfgnYJHMduAB/x3/WBVyo b7XHonEkCUYz6MmjHX+kZwUg== Received: from computer ( [10.1.1.1]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id d7a23aa6 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Sat, 25 Feb 2023 19:45:36 +0100 (CET) From: Manuel Giraud To: Stefan Kangas Subject: Re: bug#61394: 30.0.50; [PATCH] Image-dired thumb name based on content In-Reply-To: (Stefan Kangas's message of "Sun, 19 Feb 2023 08:19:23 -0800") References: <874jruy7xx.fsf@ledu-giraud.fr> <87ttztk0yw.fsf@tcd.ie> <87v8k9s6j9.fsf@ledu-giraud.fr> <83ilg8jzti.fsf@gnu.org> <87k00oo03r.fsf@ledu-giraud.fr> <838rh4jlsq.fsf@gnu.org> <87bklzol8n.fsf@ledu-giraud.fr> <877cwmo8ij.fsf@ledu-giraud.fr> <87y1oz54bn.fsf@ledu-giraud.fr> <87wn4dra0h.fsf@ledu-giraud.fr> Date: Sat, 25 Feb 2023 19:45:34 +0100 Message-ID: <87bklhtwhd.fsf@ledu-giraud.fr> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 61394 Cc: contovob@tcd.ie, Eli Zaretskii , 61394@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Hi, Here is a new version of the patch that, I think, addresses all the issues raised by Stefan. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-New-option-image-dired-thumb-naming-bug-61394.patch >From 3003c1f7bd5b65c076b33fe5ae986eeebdee6cce Mon Sep 17 00:00:00 2001 From: Manuel Giraud Date: Sat, 25 Feb 2023 19:27:07 +0100 Subject: [PATCH] New option 'image-dired-thumb-naming' (bug#61394) * lisp/image/image-dired.el (image-dired-thumb-naming): New user option to control thumbnail name. * lisp/image/image-dired-util.el (image-dired-thumb-name): Update to use new user option and compute contents SHA-1 if needed. (image-dired-contents-sha1): New function to compute the SHA-1 of the first 4KiB of a file. --- etc/NEWS | 4 ++ lisp/image/image-dired-util.el | 84 +++++++++++++++++++++------------- lisp/image/image-dired.el | 26 ++++++++++- 3 files changed, 79 insertions(+), 35 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 4b0e4e6bd46..eca4fdaafe8 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -192,6 +192,10 @@ This command adds a docstring comment to the current defun. If a comment already exists, point is only moved to the comment. It is bound to 'C-c C-d' in 'go-ts-mode'. +** Image Dired +*** New user option 'image-dired-thumb-naming'. +You can now configure how a thumbnail is named using this option. + * New Modes and Packages in Emacs 30.1 diff --git a/lisp/image/image-dired-util.el b/lisp/image/image-dired-util.el index a80b3afc0f3..3f6880fc807 100644 --- a/lisp/image/image-dired-util.el +++ b/lisp/image/image-dired-util.el @@ -30,6 +30,7 @@ (eval-when-compile (require 'cl-lib)) (defvar image-dired-dir) +(defvar image-dired-thumb-naming) (defvar image-dired-thumbnail-storage) (defconst image-dired--thumbnail-standard-sizes @@ -57,42 +58,59 @@ image-dired-dir (message "Thumbnail directory created: %s" image-dired-dir)) image-dired-dir)) +(defun image-dired-contents-sha1 (filename) + "Compute the SHA-1 of the first 4KiB of FILENAME's contents." + (with-temp-buffer + (insert-file-contents-literally filename nil 0 4096) + (sha1 (current-buffer)))) + (defun image-dired-thumb-name (file) "Return absolute file name for thumbnail FILE. -Depending on the value of `image-dired-thumbnail-storage', the -file name of the thumbnail will vary: -- For `use-image-dired-dir', make a SHA1-hash of the image file's - directory name and add that to make the thumbnail file name - unique. -- For `per-directory' storage, just add a subdirectory. -- For `standard' storage, produce the file name according to the - Thumbnail Managing Standard. Among other things, an MD5-hash - of the image file's directory name will be added to the - filename. -See also `image-dired-thumbnail-storage'." +Depending on the value of `image-dired-thumbnail-storage' and +`image-dired-thumb-naming', the file name of the thumbnail will +vary: + +- If `image-dired-thumbnail-storage' is set to one of the value + of `image-dired--thumbnail-standard-sizes', produce the file + name according to the Thumbnail Managing Standard. Among other + things, an MD5-hash of the image file's directory name will be + added to the file name. + +- Otherwise `image-dired-thumbnail-storage' is used to set the + directory where to store the thumbnail. In this latter case + the name given to the thumbnail depends on the value of + `image-dired-thumb-naming'. + +See also `image-dired-thumbnail-storage' and +`image-dired-thumb-naming'." (let ((file (expand-file-name file))) - (cond ((memq image-dired-thumbnail-storage - image-dired--thumbnail-standard-sizes) - (let ((thumbdir (cl-case image-dired-thumbnail-storage - (standard "thumbnails/normal") - (standard-large "thumbnails/large") - (standard-x-large "thumbnails/x-large") - (standard-xx-large "thumbnails/xx-large")))) - (expand-file-name - ;; MD5 is mandated by the Thumbnail Managing Standard. - (concat (md5 (concat "file://" file)) ".png") - (expand-file-name thumbdir (xdg-cache-home))))) - ((or (eq 'image-dired image-dired-thumbnail-storage) - ;; Maintained for backwards compatibility: - (eq 'use-image-dired-dir image-dired-thumbnail-storage)) - (expand-file-name (format "%s.jpg" (sha1 file)) - (image-dired-dir))) - ((eq 'per-directory image-dired-thumbnail-storage) - (expand-file-name (format "%s.thumb.jpg" - (file-name-nondirectory file)) - (expand-file-name - ".image-dired" - (file-name-directory file))))))) + (if (memq image-dired-thumbnail-storage + image-dired--thumbnail-standard-sizes) + (let ((thumbdir (cl-case image-dired-thumbnail-storage + (standard "thumbnails/normal") + (standard-large "thumbnails/large") + (standard-x-large "thumbnails/x-large") + (standard-xx-large "thumbnails/xx-large")))) + (expand-file-name + ;; MD5 and PNG is mandated by the Thumbnail Managing + ;; Standard. + (concat (md5 (concat "file://" file)) ".png") + (expand-file-name thumbdir (xdg-cache-home)))) + (let ((name (if (eq 'sha1-contents image-dired-thumb-naming) + (image-dired-contents-sha1 file) + ;; Defaults to SHA-1 of file name + (if (eq 'per-directory image-dired-thumbnail-storage) + (sha1 (file-name-nondirectory file)) + (sha1 file))))) + (cond ((or (eq 'image-dired image-dired-thumbnail-storage) + ;; Maintained for backwards compatibility: + (eq 'use-image-dired-dir image-dired-thumbnail-storage)) + (expand-file-name (format "%s.jpg" name) (image-dired-dir))) + ((eq 'per-directory image-dired-thumbnail-storage) + (expand-file-name (format "%s.jpg" name) + (expand-file-name + ".image-dired" + (file-name-directory file))))))))) (defvar image-dired-thumbnail-buffer "*image-dired*" "Image-Dired's thumbnail buffer.") diff --git a/lisp/image/image-dired.el b/lisp/image/image-dired.el index 8e2a75a418f..8d56fd1e462 100644 --- a/lisp/image/image-dired.el +++ b/lisp/image/image-dired.el @@ -162,8 +162,27 @@ image-dired-dir `image-dired-thumbnail-storage'." :type 'directory) +(defcustom image-dired-thumb-naming 'sha1-filename + "How `image-dired' names thumbnail files. +When set to `sha1-filename' the name of thumbnail is built by +computing the SHA-1 of the full file name of the image. + +When set to `sha1-contents' the name of thumbnail is built by +computing the SHA-1 of first 4KiB of the image contents (See +`image-dired-contents-sha1'). + +In both case, a \"jpg\" extension is appended to save as JPEG. + +The value of this option is ignored if Image-Dired is customized +to use the Thumbnail Managing Standard. See +`image-dired-thumbnail-storage'." + :type '(choice :tag "How to name thumbnail files" + (const :tag "SHA-1 of the image file name" sha1-filename) + (const :tag "SHA-1 of the image contents" sha1-contents)) + :version "30.1") + (defcustom image-dired-thumbnail-storage 'image-dired - "How `image-dired' stores thumbnail files. + "Where `image-dired' stores thumbnail files. There are three ways that Image-Dired can store and generate thumbnails: @@ -189,6 +208,9 @@ image-dired-thumbnail-storage Set this user option to `per-directory'. +To control the naming of thumbnails for alternatives (2) and (3) +above, customize the value of `image-dired-thumb-naming'. + To control the default size of thumbnails for alternatives (2) and (3) above, customize the value of `image-dired-thumb-size'. @@ -197,7 +219,7 @@ image-dired-thumbnail-storage For more information on the Thumbnail Managing Standard, see: https://specifications.freedesktop.org/thumbnail-spec/thumbnail-spec-latest.html" - :type '(choice :tag "How to store thumbnail files" + :type '(choice :tag "Where to store thumbnail files" (const :tag "Use image-dired-dir" image-dired) (const :tag "Thumbnail Managing Standard (normal 128x128)" standard) -- 2.39.1 --=-=-= Content-Type: text/plain -- Manuel Giraud --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 26 15:18:19 2023 Received: (at 61394) by debbugs.gnu.org; 26 Jul 2023 19:18:19 +0000 Received: from localhost ([127.0.0.1]:50099 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qOk1b-0001Cj-2p for submit@debbugs.gnu.org; Wed, 26 Jul 2023 15:18:19 -0400 Received: from ledu-giraud.fr ([51.159.28.247]:40514) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qOk1Y-0001CW-F6 for 61394@debbugs.gnu.org; Wed, 26 Jul 2023 15:18:18 -0400 DKIM-Signature: v=1; a=ed25519-sha256; c=simple/simple; s=ed25519; bh=fSwcNg8o AWVXaPjn1cw2x1sqMGBJmZUs8NTto+a9gpQ=; h=date:references:in-reply-to: subject:cc:to:from; d=ledu-giraud.fr; b=YsYcCnyvz1EjKN/znaARmqqejA9Of5 rXcCbqA/JXl3AGs1ARvw/wm0M2JoNvwAHBkCGrD0I3rMIoVUcfXwoBBw== DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=fSwcNg8oAWVXaPjn 1cw2x1sqMGBJmZUs8NTto+a9gpQ=; h=date:references:in-reply-to:subject: cc:to:from; d=ledu-giraud.fr; b=CHPj6PvdTfvfMb5XWPwgF+sCzoivXBM848KGC+ hkuHm2uP4tB//o0wy1SF8jmA1hOvyAGi5ABdeYSIA19AscIPYiq1I6+IbKeoYJavU2xsT+ BYyVsKe52cbUJar6EEvZPP1i+duj4q5rm0thCthCM7e9tyavzHW5YS5LvE089ZA0tW4G+S ggh7Ji/Zygps2mZtJf8Lxpij3FQtxIgsauA+uk1R/m5YUhteP0/Auxekm1aKuLIR1VIohx UidvlKAX4dNR59G5GenHl+iiH4QkVhfvcwObYF0k5lMwAITEwjQoRaZtlEKfUMHs6Spy31 Uwx9mOv3QAQ9RB56fnTb3f+w== Received: from computer ( [10.1.1.1]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id aa99e779 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 26 Jul 2023 21:18:14 +0200 (CEST) From: Manuel Giraud To: Stefan Kangas Subject: Re: bug#61394: 30.0.50; [PATCH] Image-dired thumb name based on content In-Reply-To: <87bklhtwhd.fsf@ledu-giraud.fr> (Manuel Giraud's message of "Sat, 25 Feb 2023 19:45:34 +0100") References: <874jruy7xx.fsf@ledu-giraud.fr> <87ttztk0yw.fsf@tcd.ie> <87v8k9s6j9.fsf@ledu-giraud.fr> <83ilg8jzti.fsf@gnu.org> <87k00oo03r.fsf@ledu-giraud.fr> <838rh4jlsq.fsf@gnu.org> <87bklzol8n.fsf@ledu-giraud.fr> <877cwmo8ij.fsf@ledu-giraud.fr> <87y1oz54bn.fsf@ledu-giraud.fr> <87wn4dra0h.fsf@ledu-giraud.fr> <87bklhtwhd.fsf@ledu-giraud.fr> Date: Wed, 26 Jul 2023 21:18:12 +0200 Message-ID: <871qgumqh7.fsf@ledu-giraud.fr> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 61394 Cc: contovob@tcd.ie, Eli Zaretskii , 61394@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Stefan, Just a "ping" on this. Do you think it could go in Emacs 30? -- Manuel Giraud From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 27 03:03:45 2023 Received: (at 61394) by debbugs.gnu.org; 27 Jul 2023 07:03:45 +0000 Received: from localhost ([127.0.0.1]:40584 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qOv2H-0007a6-CX for submit@debbugs.gnu.org; Thu, 27 Jul 2023 03:03:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54028) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qOv2C-0007Zo-TR for 61394@debbugs.gnu.org; Thu, 27 Jul 2023 03:03:44 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qOv27-0002CN-4l; Thu, 27 Jul 2023 03:03:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=FoTVYfNjf1E3GBK5FnPL2eR08o0gpGzaLVdc2TtRq7g=; b=YAcRZZxzaSay ikBnM2varNdfsmGoQMB8wYywCLxS9fENTU9e43p4WVvY6N9GxrQGcgYCPd1eo4DPcfu1VCqgOiQvi AircjBMY5d1ngU+3E31RxLVqDryXeQAN1xPphJtKVjk2Ds3BnVqxuvOLkUbrffk/P2fMjZgYLBBZM fJ6v+S0AnkIOOXhEl9o1g1Nerdg/FzB4vjjACshAFJPcbvC/nkEfYJ2h369KBHbKLx9EjnxQme+tH c0bLiywwssD6myWD0M7oEbaE2WU8k6J71I93XCvxHRXxAYTPvcSfmDDwCuSbJdc6DEtsk4/d/8PPw 1UlX3cwr4PuGIsqOcsvuVA==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qOv26-0005pa-EW; Thu, 27 Jul 2023 03:03:34 -0400 Date: Thu, 27 Jul 2023 10:04:23 +0300 Message-Id: <83ila5n8co.fsf@gnu.org> From: Eli Zaretskii To: Manuel Giraud In-Reply-To: <871qgumqh7.fsf@ledu-giraud.fr> (message from Manuel Giraud on Wed, 26 Jul 2023 21:18:12 +0200) Subject: Re: bug#61394: 30.0.50; [PATCH] Image-dired thumb name based on content References: <874jruy7xx.fsf@ledu-giraud.fr> <87ttztk0yw.fsf@tcd.ie> <87v8k9s6j9.fsf@ledu-giraud.fr> <83ilg8jzti.fsf@gnu.org> <87k00oo03r.fsf@ledu-giraud.fr> <838rh4jlsq.fsf@gnu.org> <87bklzol8n.fsf@ledu-giraud.fr> <877cwmo8ij.fsf@ledu-giraud.fr> <87y1oz54bn.fsf@ledu-giraud.fr> <87wn4dra0h.fsf@ledu-giraud.fr> <87bklhtwhd.fsf@ledu-giraud.fr> <871qgumqh7.fsf@ledu-giraud.fr> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 61394 Cc: contovob@tcd.ie, stefankangas@gmail.com, 61394@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Manuel Giraud > Cc: contovob@tcd.ie, Eli Zaretskii , 61394@debbugs.gnu.org > Date: Wed, 26 Jul 2023 21:18:12 +0200 > > Hi Stefan, > > Just a "ping" on this. Do you think it could go in Emacs 30? Thanks for the reminder. I think we should install this now. So please rebase on the current master branch and repost, and I will install it then. From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 27 09:53:04 2023 Received: (at 61394) by debbugs.gnu.org; 27 Jul 2023 13:53:04 +0000 Received: from localhost ([127.0.0.1]:40994 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qP1QN-0004eK-B4 for submit@debbugs.gnu.org; Thu, 27 Jul 2023 09:53:03 -0400 Received: from ledu-giraud.fr ([51.159.28.247]:47059) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qP1QJ-0004dl-Nr for 61394@debbugs.gnu.org; Thu, 27 Jul 2023 09:53:01 -0400 DKIM-Signature: v=1; a=ed25519-sha256; c=simple/simple; s=ed25519; bh=lkR+e6VL l8oDSAuDie0aj9xY9TaIfJwGE6xLgAhS1MQ=; h=date:references:in-reply-to: subject:cc:to:from; d=ledu-giraud.fr; b=PKkUyRiYVzqDNd5BvQDWuBokam/vkC 1w1Yh/67pyPkS2GbEaV2fPxuVLwITuaa9Qz0Dhd5K8GomlXtLnI7L+Ag== DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=lkR+e6VLl8oDSAuD ie0aj9xY9TaIfJwGE6xLgAhS1MQ=; h=date:references:in-reply-to:subject: cc:to:from; d=ledu-giraud.fr; b=yz5nN+trbsAYeuzDYg1bZPU0NXsg50+hA1qK05 craJIg434F+s6aVXZdooxwXITJt3ZzKTWIucWxybp3WvhIlRwRD/qhgE4a0ExnwcHb4tjU 9BlN91rQoUb5i1ktc6tD6Q0zPD11ZrJMOyBSRMb2Sk18sIhPqYf++dKvIPnizQqdLRYlEW XE1v1fJcHKgp5zihMOHxRL7M1qteFZP+lboh9iPhIAJsWN3WUOvHolsgHyubS7RASqcy87 bdiUoGiOGPN4sdY3+hNHpB6b5E8Pc/7YwaXU9r/Lsa4ijfCPiJlTNuNbO1b0C8VTVtO56t 3giNYQvLwUTsbGGwWUqFx0Pg== Received: from computer ( [10.1.1.1]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id fd6149ec (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Thu, 27 Jul 2023 15:52:57 +0200 (CEST) From: Manuel Giraud To: Eli Zaretskii Subject: Re: bug#61394: 30.0.50; [PATCH] Image-dired thumb name based on content In-Reply-To: <83ila5n8co.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 27 Jul 2023 10:04:23 +0300") References: <874jruy7xx.fsf@ledu-giraud.fr> <87ttztk0yw.fsf@tcd.ie> <87v8k9s6j9.fsf@ledu-giraud.fr> <83ilg8jzti.fsf@gnu.org> <87k00oo03r.fsf@ledu-giraud.fr> <838rh4jlsq.fsf@gnu.org> <87bklzol8n.fsf@ledu-giraud.fr> <877cwmo8ij.fsf@ledu-giraud.fr> <87y1oz54bn.fsf@ledu-giraud.fr> <87wn4dra0h.fsf@ledu-giraud.fr> <87bklhtwhd.fsf@ledu-giraud.fr> <871qgumqh7.fsf@ledu-giraud.fr> <83ila5n8co.fsf@gnu.org> Date: Thu, 27 Jul 2023 15:52:55 +0200 Message-ID: <87fs59qx54.fsf@ledu-giraud.fr> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 61394 Cc: contovob@tcd.ie, stefankangas@gmail.com, 61394@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Eli Zaretskii writes: > Thanks for the reminder. I think we should install this now. So > please rebase on the current master branch and repost, and I will > install it then. Thanks. Here is the rebased version of the patch. -- Manuel Giraud --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-New-option-image-dired-thumb-naming-bug-61394.patch >From 83002e2cda2c3c8c28b2e37837625709fc4ca233 Mon Sep 17 00:00:00 2001 From: Manuel Giraud Date: Sat, 25 Feb 2023 19:27:07 +0100 Subject: [PATCH] New option 'image-dired-thumb-naming' (bug#61394) * lisp/image/image-dired.el (image-dired-thumb-naming): New user option to control thumbnail name. * lisp/image/image-dired-util.el (image-dired-thumb-name): Update to use new user option and compute contents SHA-1 if needed. (image-dired-contents-sha1): New function to compute the SHA-1 of the first 4KiB of a file. --- etc/NEWS | 5 ++ lisp/image/image-dired-util.el | 84 +++++++++++++++++++++------------- lisp/image/image-dired.el | 26 ++++++++++- 3 files changed, 80 insertions(+), 35 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index d0dab755212..a8e7d97df7e 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -567,6 +567,11 @@ Similarly to buffer restoration by Desktop, 'recentf-mode' checking of the accessibility of remote files can now time out if 'remote-file-name-access-timeout' is set to a positive number. +** Image Dired + +*** New user option 'image-dired-thumb-naming'. +You can now configure how a thumbnail is named using this option. + * New Modes and Packages in Emacs 30.1 diff --git a/lisp/image/image-dired-util.el b/lisp/image/image-dired-util.el index a80b3afc0f3..3f6880fc807 100644 --- a/lisp/image/image-dired-util.el +++ b/lisp/image/image-dired-util.el @@ -30,6 +30,7 @@ (eval-when-compile (require 'cl-lib)) (defvar image-dired-dir) +(defvar image-dired-thumb-naming) (defvar image-dired-thumbnail-storage) (defconst image-dired--thumbnail-standard-sizes @@ -57,42 +58,59 @@ image-dired-dir (message "Thumbnail directory created: %s" image-dired-dir)) image-dired-dir)) +(defun image-dired-contents-sha1 (filename) + "Compute the SHA-1 of the first 4KiB of FILENAME's contents." + (with-temp-buffer + (insert-file-contents-literally filename nil 0 4096) + (sha1 (current-buffer)))) + (defun image-dired-thumb-name (file) "Return absolute file name for thumbnail FILE. -Depending on the value of `image-dired-thumbnail-storage', the -file name of the thumbnail will vary: -- For `use-image-dired-dir', make a SHA1-hash of the image file's - directory name and add that to make the thumbnail file name - unique. -- For `per-directory' storage, just add a subdirectory. -- For `standard' storage, produce the file name according to the - Thumbnail Managing Standard. Among other things, an MD5-hash - of the image file's directory name will be added to the - filename. -See also `image-dired-thumbnail-storage'." +Depending on the value of `image-dired-thumbnail-storage' and +`image-dired-thumb-naming', the file name of the thumbnail will +vary: + +- If `image-dired-thumbnail-storage' is set to one of the value + of `image-dired--thumbnail-standard-sizes', produce the file + name according to the Thumbnail Managing Standard. Among other + things, an MD5-hash of the image file's directory name will be + added to the file name. + +- Otherwise `image-dired-thumbnail-storage' is used to set the + directory where to store the thumbnail. In this latter case + the name given to the thumbnail depends on the value of + `image-dired-thumb-naming'. + +See also `image-dired-thumbnail-storage' and +`image-dired-thumb-naming'." (let ((file (expand-file-name file))) - (cond ((memq image-dired-thumbnail-storage - image-dired--thumbnail-standard-sizes) - (let ((thumbdir (cl-case image-dired-thumbnail-storage - (standard "thumbnails/normal") - (standard-large "thumbnails/large") - (standard-x-large "thumbnails/x-large") - (standard-xx-large "thumbnails/xx-large")))) - (expand-file-name - ;; MD5 is mandated by the Thumbnail Managing Standard. - (concat (md5 (concat "file://" file)) ".png") - (expand-file-name thumbdir (xdg-cache-home))))) - ((or (eq 'image-dired image-dired-thumbnail-storage) - ;; Maintained for backwards compatibility: - (eq 'use-image-dired-dir image-dired-thumbnail-storage)) - (expand-file-name (format "%s.jpg" (sha1 file)) - (image-dired-dir))) - ((eq 'per-directory image-dired-thumbnail-storage) - (expand-file-name (format "%s.thumb.jpg" - (file-name-nondirectory file)) - (expand-file-name - ".image-dired" - (file-name-directory file))))))) + (if (memq image-dired-thumbnail-storage + image-dired--thumbnail-standard-sizes) + (let ((thumbdir (cl-case image-dired-thumbnail-storage + (standard "thumbnails/normal") + (standard-large "thumbnails/large") + (standard-x-large "thumbnails/x-large") + (standard-xx-large "thumbnails/xx-large")))) + (expand-file-name + ;; MD5 and PNG is mandated by the Thumbnail Managing + ;; Standard. + (concat (md5 (concat "file://" file)) ".png") + (expand-file-name thumbdir (xdg-cache-home)))) + (let ((name (if (eq 'sha1-contents image-dired-thumb-naming) + (image-dired-contents-sha1 file) + ;; Defaults to SHA-1 of file name + (if (eq 'per-directory image-dired-thumbnail-storage) + (sha1 (file-name-nondirectory file)) + (sha1 file))))) + (cond ((or (eq 'image-dired image-dired-thumbnail-storage) + ;; Maintained for backwards compatibility: + (eq 'use-image-dired-dir image-dired-thumbnail-storage)) + (expand-file-name (format "%s.jpg" name) (image-dired-dir))) + ((eq 'per-directory image-dired-thumbnail-storage) + (expand-file-name (format "%s.jpg" name) + (expand-file-name + ".image-dired" + (file-name-directory file))))))))) (defvar image-dired-thumbnail-buffer "*image-dired*" "Image-Dired's thumbnail buffer.") diff --git a/lisp/image/image-dired.el b/lisp/image/image-dired.el index b13b3e08ce2..96a0c2ef9bc 100644 --- a/lisp/image/image-dired.el +++ b/lisp/image/image-dired.el @@ -162,8 +162,27 @@ image-dired-dir `image-dired-thumbnail-storage'." :type 'directory) +(defcustom image-dired-thumb-naming 'sha1-filename + "How `image-dired' names thumbnail files. +When set to `sha1-filename' the name of thumbnail is built by +computing the SHA-1 of the full file name of the image. + +When set to `sha1-contents' the name of thumbnail is built by +computing the SHA-1 of first 4KiB of the image contents (See +`image-dired-contents-sha1'). + +In both case, a \"jpg\" extension is appended to save as JPEG. + +The value of this option is ignored if Image-Dired is customized +to use the Thumbnail Managing Standard. See +`image-dired-thumbnail-storage'." + :type '(choice :tag "How to name thumbnail files" + (const :tag "SHA-1 of the image file name" sha1-filename) + (const :tag "SHA-1 of the image contents" sha1-contents)) + :version "30.1") + (defcustom image-dired-thumbnail-storage 'image-dired - "How `image-dired' stores thumbnail files. + "Where `image-dired' stores thumbnail files. There are three ways that Image-Dired can store and generate thumbnails: @@ -189,6 +208,9 @@ image-dired-thumbnail-storage Set this user option to `per-directory'. +To control the naming of thumbnails for alternatives (2) and (3) +above, customize the value of `image-dired-thumb-naming'. + To control the default size of thumbnails for alternatives (2) and (3) above, customize the value of `image-dired-thumb-size'. @@ -197,7 +219,7 @@ image-dired-thumbnail-storage For more information on the Thumbnail Managing Standard, see: https://specifications.freedesktop.org/thumbnail-spec/thumbnail-spec-latest.html" - :type '(choice :tag "How to store thumbnail files" + :type '(choice :tag "Where to store thumbnail files" (const :tag "Use image-dired-dir" image-dired) (const :tag "Thumbnail Managing Standard (normal 128x128)" standard) -- 2.40.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 27 10:15:47 2023 Received: (at 61394) by debbugs.gnu.org; 27 Jul 2023 14:15:47 +0000 Received: from localhost ([127.0.0.1]:42758 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qP1mM-0005cv-R8 for submit@debbugs.gnu.org; Thu, 27 Jul 2023 10:15:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44472) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qP1mJ-0005cg-9j for 61394@debbugs.gnu.org; Thu, 27 Jul 2023 10:15:46 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qP1mD-0002bz-Bf; Thu, 27 Jul 2023 10:15:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=jNOrc2D+aBVlq3Bl3JetK4XgMHFW/69L4m0c6Ktu/KU=; b=ci9sSy+6KR7h 1glp7kaZs1PTr9T6+QK30WVgeaA6dhuQWRB0asNG1jt2KK6uJyvJfXZiUio/XUo0I5Lki0nMraU19 qGVwo2DoXcPPE+VgDPijz6LmOuYubcb3N1jhtQ5EZ8tDsG+PAyCpJnIzjv95E3+ZI59NWYIXmdA3O Jmfp4H/IPoP0xuA/oX4g0TQEMJIrSnk62SN11l6YhZzb3RnR6myyqPpkNu/w62OjsqoIW+tyKJA4I QW4AxfSWpPQPn5DazAoHeM4TutK/cGER0StDSZH7EU5AQPuGtUU0FAK9p0CfaIr8Ywqb0xgMszWva bjVWORhWQvAAJKivdrCWpQ==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qP1mC-0007Rx-J9; Thu, 27 Jul 2023 10:15:37 -0400 Date: Thu, 27 Jul 2023 17:16:26 +0300 Message-Id: <83wmyll9s5.fsf@gnu.org> From: Eli Zaretskii To: Manuel Giraud In-Reply-To: <87fs59qx54.fsf@ledu-giraud.fr> (message from Manuel Giraud on Thu, 27 Jul 2023 15:52:55 +0200) Subject: Re: bug#61394: 30.0.50; [PATCH] Image-dired thumb name based on content References: <874jruy7xx.fsf@ledu-giraud.fr> <87ttztk0yw.fsf@tcd.ie> <87v8k9s6j9.fsf@ledu-giraud.fr> <83ilg8jzti.fsf@gnu.org> <87k00oo03r.fsf@ledu-giraud.fr> <838rh4jlsq.fsf@gnu.org> <87bklzol8n.fsf@ledu-giraud.fr> <877cwmo8ij.fsf@ledu-giraud.fr> <87y1oz54bn.fsf@ledu-giraud.fr> <87wn4dra0h.fsf@ledu-giraud.fr> <87bklhtwhd.fsf@ledu-giraud.fr> <871qgumqh7.fsf@ledu-giraud.fr> <83ila5n8co.fsf@gnu.org> <87fs59qx54.fsf@ledu-giraud.fr> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 61394 Cc: contovob@tcd.ie, stefankangas@gmail.com, 61394@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Manuel Giraud > Cc: stefankangas@gmail.com, contovob@tcd.ie, 61394@debbugs.gnu.org > Date: Thu, 27 Jul 2023 15:52:55 +0200 > > Eli Zaretskii writes: > > > Thanks for the reminder. I think we should install this now. So > > please rebase on the current master branch and repost, and I will > > install it then. > > Thanks. Here is the rebased version of the patch. Thanks, installed. But now 1 set in image-dired-util-tests fails; it sounds like the method of producing per-directory thumbnails has changed, and now produces a SHA-1 hash? Can you please look into fixing that test? From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 27 17:30:38 2023 Received: (at 61394) by debbugs.gnu.org; 27 Jul 2023 21:30:38 +0000 Received: from localhost ([127.0.0.1]:43255 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qP8ZC-0000ke-9R for submit@debbugs.gnu.org; Thu, 27 Jul 2023 17:30:38 -0400 Received: from ledu-giraud.fr ([51.159.28.247]:26738) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qP8Z7-0000kN-2H for 61394@debbugs.gnu.org; Thu, 27 Jul 2023 17:30:37 -0400 DKIM-Signature: v=1; a=ed25519-sha256; c=simple/simple; s=ed25519; bh=Gbzo21f9 zKaM9kBtEnl914jgUpd+Mg6TH6qx18UMbnw=; h=date:references:in-reply-to: subject:cc:to:from; d=ledu-giraud.fr; b=hd49jiGzM66U7Ld/fm5PAmWq88BYPT uxjtp7lht8E1Rrhu35yuym9xsfhVXe/g4xDiSMaandEb8kZsofuqZrCA== DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=Gbzo21f9zKaM9kBt Enl914jgUpd+Mg6TH6qx18UMbnw=; h=date:references:in-reply-to:subject: cc:to:from; d=ledu-giraud.fr; b=nU4B9Yj+TLbnq7c9JbCiyIUDtv+2RSEYcYEsX6 AOcHAlzTUGD1dj83qvXDLW1vi99TQbC6X8knIR2lslwuInd8OkN3zQMwi/V0+S8Wsi2bR+ yYbEOCBXU4jaoGa4IOB5NJsR2RzYrxlN8I2IrhPezv993M6QN1UGCsSZgAkp9/gwHbgpMJ bDzCha9180CIKg4nj0u5yN2uoUTRdfxoDf77tNzsjMQmrPuCmGwlkd9paiSG7k+UuTmxsg m7D+3k8oStEb1QjBHrJoNjhT0GT0Ew+G7L4nIcV9HJub6x0Btw6n9Z3Piehy57i5C9qh5J oE8ghCkumFdvi2kFQTpEVluA== Received: from computer ( [10.1.1.1]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id d6ef042b (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Thu, 27 Jul 2023 23:30:31 +0200 (CEST) From: Manuel Giraud To: Eli Zaretskii Subject: Re: bug#61394: 30.0.50; [PATCH] Image-dired thumb name based on content In-Reply-To: <83wmyll9s5.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 27 Jul 2023 17:16:26 +0300") References: <874jruy7xx.fsf@ledu-giraud.fr> <87ttztk0yw.fsf@tcd.ie> <87v8k9s6j9.fsf@ledu-giraud.fr> <83ilg8jzti.fsf@gnu.org> <87k00oo03r.fsf@ledu-giraud.fr> <838rh4jlsq.fsf@gnu.org> <87bklzol8n.fsf@ledu-giraud.fr> <877cwmo8ij.fsf@ledu-giraud.fr> <87y1oz54bn.fsf@ledu-giraud.fr> <87wn4dra0h.fsf@ledu-giraud.fr> <87bklhtwhd.fsf@ledu-giraud.fr> <871qgumqh7.fsf@ledu-giraud.fr> <83ila5n8co.fsf@gnu.org> <87fs59qx54.fsf@ledu-giraud.fr> <83wmyll9s5.fsf@gnu.org> Date: Thu, 27 Jul 2023 23:30:29 +0200 Message-ID: <87bkfxcaa2.fsf@ledu-giraud.fr> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 61394 Cc: contovob@tcd.ie, stefankangas@gmail.com, 61394@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Eli Zaretskii writes: [...] > Thanks, installed. But now 1 set in image-dired-util-tests fails; it > sounds like the method of producing per-directory thumbnails has > changed, and now produces a SHA-1 hash? Can you please look into > fixing that test? Ok, I think this patch should do. -- Manuel Giraud --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Fix-test-after-83b6a8a5147.patch >From 1460fb462300aac70faf99724efe126c72ad5fe6 Mon Sep 17 00:00:00 2001 From: Manuel Giraud Date: Thu, 27 Jul 2023 23:26:30 +0200 Subject: [PATCH] Fix test after 83b6a8a5147 --- test/lisp/image/image-dired-util-tests.el | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/test/lisp/image/image-dired-util-tests.el b/test/lisp/image/image-dired-util-tests.el index 1f3747a82b1..273a32d5dbb 100644 --- a/test/lisp/image/image-dired-util-tests.el +++ b/test/lisp/image/image-dired-util-tests.el @@ -57,20 +57,23 @@ image-dired-thumb-name/image-dired "jpg"))))) (ert-deftest image-dired-thumb-name/per-directory () - (let ((image-dired-thumbnail-storage 'per-directory)) - (should (file-name-absolute-p (image-dired-thumb-name "foo.jpg"))) - (should (file-name-absolute-p (image-dired-thumb-name "/tmp/foo.jpg"))) + (let ((image-dired-thumbnail-storage 'per-directory) + (rel-path "foo.jpg") + (abs-path "/tmp/foo.jpg") + (hash-name (concat (sha1 "foo.jpg") ".jpg"))) + (should (file-name-absolute-p (image-dired-thumb-name rel-path))) + (should (file-name-absolute-p (image-dired-thumb-name abs-path))) (should (equal - (file-name-nondirectory (image-dired-thumb-name "foo.jpg")) - (file-name-nondirectory (image-dired-thumb-name "/tmp/foo.jpg")))) + (file-name-nondirectory (image-dired-thumb-name rel-path)) + (file-name-nondirectory (image-dired-thumb-name abs-path)))) ;; The cdr below avoids the system dependency in the car of the ;; list returned by 'file-name-split': it's "" on Posix systems, ;; but the drive letter on MS-Windows. (should (equal (cdr (file-name-split - (image-dired-thumb-name "/tmp/foo.jpg"))) - '("tmp" ".image-dired" "foo.jpg.thumb.jpg"))) + (image-dired-thumb-name abs-path))) + (list "tmp" ".image-dired" hash-name))) (should (equal (file-name-nondirectory - (image-dired-thumb-name "foo.jpg")) - "foo.jpg.thumb.jpg")))) + (image-dired-thumb-name rel-path)) + hash-name)))) ;;; image-dired-util-tests.el ends here -- 2.40.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 28 02:54:38 2023 Received: (at 61394) by debbugs.gnu.org; 28 Jul 2023 06:54:38 +0000 Received: from localhost ([127.0.0.1]:43523 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qPHMw-0007Ak-SS for submit@debbugs.gnu.org; Fri, 28 Jul 2023 02:54:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53254) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qPHMq-0007AS-Ra for 61394@debbugs.gnu.org; Fri, 28 Jul 2023 02:54:33 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qPHMk-0002EH-Ec; Fri, 28 Jul 2023 02:54:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=H7TvAyK21shVztoGLojJ3R/wHCBSwSMaIHvSGNBBqgM=; b=i/knye0nzGjc uBo88UnkgDl87in+Dqw+fqpJUUFYFElU6z8RRD1pTxpSSlkY0nTVrDXs1FIleYAbBi595Oe0HuG38 Go2Pg8/Dwmf6EZQuPYf5th6k+0eB5z8fghx0/M9NcqU42V5nJllkjq6O9Op1xVwQrgLVIKpC6SL2c 2xY0VZNXStEya0I55p4l1Ni3BXW3+EHj7zNL7FFUt8m4SL/t2o+meNT4oFc17nhoCo2cI2Od1tBSL KhXpvBYDnHRTWJXO9W7B1Wfe2nuNw2FWGg+jJzYt5HrY4kkZRu8znRRY7sqhvGPKN85dmBNQXl8Re Rw1y7ivZlwFC7ZtmIYnrAQ==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qPHMj-0006Si-So; Fri, 28 Jul 2023 02:54:22 -0400 Date: Fri, 28 Jul 2023 09:55:13 +0300 Message-Id: <83wmykjzji.fsf@gnu.org> From: Eli Zaretskii To: Manuel Giraud In-Reply-To: <87bkfxcaa2.fsf@ledu-giraud.fr> (message from Manuel Giraud on Thu, 27 Jul 2023 23:30:29 +0200) Subject: Re: bug#61394: 30.0.50; [PATCH] Image-dired thumb name based on content References: <874jruy7xx.fsf@ledu-giraud.fr> <87ttztk0yw.fsf@tcd.ie> <87v8k9s6j9.fsf@ledu-giraud.fr> <83ilg8jzti.fsf@gnu.org> <87k00oo03r.fsf@ledu-giraud.fr> <838rh4jlsq.fsf@gnu.org> <87bklzol8n.fsf@ledu-giraud.fr> <877cwmo8ij.fsf@ledu-giraud.fr> <87y1oz54bn.fsf@ledu-giraud.fr> <87wn4dra0h.fsf@ledu-giraud.fr> <87bklhtwhd.fsf@ledu-giraud.fr> <871qgumqh7.fsf@ledu-giraud.fr> <83ila5n8co.fsf@gnu.org> <87fs59qx54.fsf@ledu-giraud.fr> <83wmyll9s5.fsf@gnu.org> <87bkfxcaa2.fsf@ledu-giraud.fr> X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 61394 Cc: contovob@tcd.ie, stefankangas@gmail.com, 61394@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Manuel Giraud > Cc: stefankangas@gmail.com, contovob@tcd.ie, 61394@debbugs.gnu.org > Date: Thu, 27 Jul 2023 23:30:29 +0200 > > Eli Zaretskii writes: > > [...] > > > Thanks, installed. But now 1 set in image-dired-util-tests fails; it > > sounds like the method of producing per-directory thumbnails has > > changed, and now produces a SHA-1 hash? Can you please look into > > fixing that test? > > Ok, I think this patch should do. Thanks, the tests now pass, but I wonder about this part: > (should (equal (cdr (file-name-split > - (image-dired-thumb-name "/tmp/foo.jpg"))) > - '("tmp" ".image-dired" "foo.jpg.thumb.jpg"))) > + (image-dired-thumb-name abs-path))) > + (list "tmp" ".image-dired" hash-name))) Does this mean that thumbnail naming under 'per-directory' has changed, and it now uses the SHA-1 hash of the base-name? IOW, does this mean your changes for bug#61394 included incompatible changes in behavior? From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 28 05:33:26 2023 Received: (at 61394) by debbugs.gnu.org; 28 Jul 2023 09:33:26 +0000 Received: from localhost ([127.0.0.1]:43718 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qPJqg-0005t9-5y for submit@debbugs.gnu.org; Fri, 28 Jul 2023 05:33:26 -0400 Received: from ledu-giraud.fr ([51.159.28.247]:31025) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qPJqd-0005sz-6m for 61394@debbugs.gnu.org; Fri, 28 Jul 2023 05:33:24 -0400 DKIM-Signature: v=1; a=ed25519-sha256; c=simple/simple; s=ed25519; bh=DCSvED+9 FdeFIQub5eigK8tSUEJ1IwopPRSau6+W8Bc=; h=date:references:in-reply-to: subject:cc:to:from; d=ledu-giraud.fr; b=f2LhUsz0FCo0CTF6/4gvpiodKoj4vp VBODnoxCclLwBrr8y2HxltdxdxtMfTvi1pCqCPEfCKABODehJNv7JBDQ== DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=DCSvED+9FdeFIQub 5eigK8tSUEJ1IwopPRSau6+W8Bc=; h=date:references:in-reply-to:subject: cc:to:from; d=ledu-giraud.fr; b=vyWs9uLUSmXL2+YMBqVfZ9NI+bjA0oMTXB2/C9 PXNyFK7LogZQnRJNR3qeljSWzjfZ4eCtik+jiQGZA/vmcuJPe6FSP01gb1Z51iHQ1444AH VNGPge0LEHv7NzB6en6B36B+tDPMgf12yXGfDQTK/+RhzOxhNZfbCGRzrKIvZekFk9QyA0 MSTHP8VfuYIZDaU/cl0y6xWYqRzSFvsxhYH4eoh82FE3zbEs5nWc/wr4GTM2I8CDJNZ6X6 s9jXtMo83vwVxHvbwb+QhpNfj2wD09U5g7x0Koe8by3FUT5PLCVO/pSLxXCT9ejLoTssrq fofB/VQpSVbW1EFtoeRRKsTg== Received: from computer ( [10.1.1.1]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id 0f717557 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Fri, 28 Jul 2023 11:33:21 +0200 (CEST) From: Manuel Giraud To: Eli Zaretskii Subject: Re: bug#61394: 30.0.50; [PATCH] Image-dired thumb name based on content In-Reply-To: <83wmykjzji.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 28 Jul 2023 09:55:13 +0300") References: <874jruy7xx.fsf@ledu-giraud.fr> <87ttztk0yw.fsf@tcd.ie> <87v8k9s6j9.fsf@ledu-giraud.fr> <83ilg8jzti.fsf@gnu.org> <87k00oo03r.fsf@ledu-giraud.fr> <838rh4jlsq.fsf@gnu.org> <87bklzol8n.fsf@ledu-giraud.fr> <877cwmo8ij.fsf@ledu-giraud.fr> <87y1oz54bn.fsf@ledu-giraud.fr> <87wn4dra0h.fsf@ledu-giraud.fr> <87bklhtwhd.fsf@ledu-giraud.fr> <871qgumqh7.fsf@ledu-giraud.fr> <83ila5n8co.fsf@gnu.org> <87fs59qx54.fsf@ledu-giraud.fr> <83wmyll9s5.fsf@gnu.org> <87bkfxcaa2.fsf@ledu-giraud.fr> <83wmykjzji.fsf@gnu.org> Date: Fri, 28 Jul 2023 11:33:19 +0200 Message-ID: <877cqkcrds.fsf@ledu-giraud.fr> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 61394 Cc: contovob@tcd.ie, stefankangas@gmail.com, 61394@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: [...] > Thanks, the tests now pass, but I wonder about this part: > >> (should (equal (cdr (file-name-split >> - (image-dired-thumb-name "/tmp/foo.jpg"))) >> - '("tmp" ".image-dired" "foo.jpg.thumb.jpg"))) >> + (image-dired-thumb-name abs-path))) >> + (list "tmp" ".image-dired" hash-name))) > > Does this mean that thumbnail naming under 'per-directory' has > changed, and it now uses the SHA-1 hash of the base-name? IOW, does > this mean your changes for bug#61394 included incompatible changes in > behavior? Yes I think it does. My patch for bug#61394 changes the previous behaviour of 'image-dired-thumbnail-storage'. Now 'image-dired-thumbnail-storage' defines where (ie. in which directory) the thumbnails are stored and I introduce 'image-dired-thumb-naming' which tells how thumbnail file ared named (ie. the file name part sans directory). 'image-dired-thumb-naming' is meaning less if 'image-dired-thumbnail-storage' is one of the "standard*" method because those methods already define storage locations, file names and even sizes. But for the "per-directory" method, I'm using 'image-dired-thumb-naming'. As we are talking about thumbnail I did not think it was a big deal but if it is I can prepare a patch, on top of the one in place, and then 'image-dired-thumb-naming' will be used only for the "image-dired" storage method. WDYT? -- Manuel Giraud From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 28 08:19:55 2023 Received: (at 61394) by debbugs.gnu.org; 28 Jul 2023 12:19:55 +0000 Received: from localhost ([127.0.0.1]:43980 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qPMRm-00078y-JC for submit@debbugs.gnu.org; Fri, 28 Jul 2023 08:19:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60410) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qPMRk-00078i-4Y for 61394@debbugs.gnu.org; Fri, 28 Jul 2023 08:19:53 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qPMRc-00038S-QA; Fri, 28 Jul 2023 08:19:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=ZUvCkN9XVM4qVFPgf5HmEfuuPzeSsHhT0p8szeNQhqQ=; b=pVUaXF319oA9 kiepF7lF1etgKnRuQKeLlZebdwvswg/vZRulcJ3RIrn+OMMQDYXZ86lmsWldY8bxN+qHC3KqBFvBt liKgY/VAOzgsMkmmxb0Zwu8PkNElO8EFyWFmbVQu5YmHIjRCWTgqoB/FfS92rTFK5zHVDWioDbC6V Qx4aeLzb3bMCVpFXF4bMd9Lc/moJ0fSiX+LFMmJFkn0azMdnoKtkj11dg0GDn5PuImmoJitaR0vOB YTN7s4I7gDqYswbRNvJ5ZYPaO1ZAd+lr3M4cpbyg6DkwAOLi61VNlEevKEBMtEnwLLZyWgHzA52+k dKE1CHdRq75bYIi+IM/iXg==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qPMRa-00032d-HQ; Fri, 28 Jul 2023 08:19:44 -0400 Date: Fri, 28 Jul 2023 15:20:35 +0300 Message-Id: <83bkfwjkh8.fsf@gnu.org> From: Eli Zaretskii To: Manuel Giraud In-Reply-To: <877cqkcrds.fsf@ledu-giraud.fr> (message from Manuel Giraud on Fri, 28 Jul 2023 11:33:19 +0200) Subject: Re: bug#61394: 30.0.50; [PATCH] Image-dired thumb name based on content References: <874jruy7xx.fsf@ledu-giraud.fr> <87ttztk0yw.fsf@tcd.ie> <87v8k9s6j9.fsf@ledu-giraud.fr> <83ilg8jzti.fsf@gnu.org> <87k00oo03r.fsf@ledu-giraud.fr> <838rh4jlsq.fsf@gnu.org> <87bklzol8n.fsf@ledu-giraud.fr> <877cwmo8ij.fsf@ledu-giraud.fr> <87y1oz54bn.fsf@ledu-giraud.fr> <87wn4dra0h.fsf@ledu-giraud.fr> <87bklhtwhd.fsf@ledu-giraud.fr> <871qgumqh7.fsf@ledu-giraud.fr> <83ila5n8co.fsf@gnu.org> <87fs59qx54.fsf@ledu-giraud.fr> <83wmyll9s5.fsf@gnu.org> <87bkfxcaa2.fsf@ledu-giraud.fr> <83wmykjzji.fsf@gnu.org> <877cqkcrds.fsf@ledu-giraud.fr> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 61394 Cc: contovob@tcd.ie, stefankangas@gmail.com, 61394@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Manuel Giraud > Cc: stefankangas@gmail.com, contovob@tcd.ie, 61394@debbugs.gnu.org > Date: Fri, 28 Jul 2023 11:33:19 +0200 > > Eli Zaretskii writes: > > [...] > > > Thanks, the tests now pass, but I wonder about this part: > > > >> (should (equal (cdr (file-name-split > >> - (image-dired-thumb-name "/tmp/foo.jpg"))) > >> - '("tmp" ".image-dired" "foo.jpg.thumb.jpg"))) > >> + (image-dired-thumb-name abs-path))) > >> + (list "tmp" ".image-dired" hash-name))) > > > > Does this mean that thumbnail naming under 'per-directory' has > > changed, and it now uses the SHA-1 hash of the base-name? IOW, does > > this mean your changes for bug#61394 included incompatible changes in > > behavior? > > Yes I think it does. My patch for bug#61394 changes the previous > behaviour of 'image-dired-thumbnail-storage'. Now > 'image-dired-thumbnail-storage' defines where (ie. in which directory) > the thumbnails are stored and I introduce 'image-dired-thumb-naming' > which tells how thumbnail file ared named (ie. the file name part sans > directory). > > 'image-dired-thumb-naming' is meaning less if > 'image-dired-thumbnail-storage' is one of the "standard*" method because > those methods already define storage locations, file names and even > sizes. But for the "per-directory" method, I'm using > 'image-dired-thumb-naming'. As we are talking about thumbnail I did not > think it was a big deal but if it is I can prepare a patch, on top of > the one in place, and then 'image-dired-thumb-naming' will be used only > for the "image-dired" storage method. WDYT? I don't think I understand all the aspects of this, as I use neither image-dired nor the thumbnails. But it sounds like an incompatible change in behavior wrt what we have in Emacs 29? If so, how do we expect this to work for users who will have configured their Emacs for some particular storage type, and then upgrade to Emacs 30 when that is released? Will the existing thumbnails still work for them? Will Emacs 30 now start storing thumbnails under differently-formatted names, even though the user didn't change his/her configuration? In general, any incompatible change in behavior (if there is indeed such a change caused by this changeset) is undesirable. So I'd like first to discuss why there was a need for the behavior change in the first place. (I'm sorry that I didn't realize there was a change in behavior before installing the changeset. It seems we never discussed that aspect in the bug#61394 discussion thread.) From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 28 12:00:59 2023 Received: (at 61394) by debbugs.gnu.org; 28 Jul 2023 16:00:59 +0000 Received: from localhost ([127.0.0.1]:45902 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qPPtj-0007br-1I for submit@debbugs.gnu.org; Fri, 28 Jul 2023 12:00:59 -0400 Received: from ledu-giraud.fr ([51.159.28.247]:32559) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qPPtg-0007bh-2Q for 61394@debbugs.gnu.org; Fri, 28 Jul 2023 12:00:57 -0400 DKIM-Signature: v=1; a=ed25519-sha256; c=simple/simple; s=ed25519; bh=ZnCSMEMb xDk2v30DNIF6KhFEf3xxJ6/1qrf7dFp/N6M=; h=date:references:in-reply-to: subject:cc:to:from; d=ledu-giraud.fr; b=8jxahj2lQKyUSNtAbf/gYGKnVBNK3g Qf4x/wgAH8ZgT3N4hBoh44hHSEOnI/LU68hqi5JlrWjcz2RfqOT5PODw== DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=ZnCSMEMbxDk2v30D NIF6KhFEf3xxJ6/1qrf7dFp/N6M=; h=date:references:in-reply-to:subject: cc:to:from; d=ledu-giraud.fr; b=DffLY1s+X/TX95Vxlsz6uekVQj8OXMXymcuq+S JTszIXSXjmUuKfWneaBmiioMEXG48v+karYys2HI/6LcC7E92mPoCpI//w8ORVcIwgJoPY mhczCi9gDHY7JNsJCXFuLmGmVZntLDWpHktO3quDzMGyQ3gppH5W67+QF7iGU8K2/x1++f k2YlNC8KZRJp09IQMUlxda3hrzYezeGcwiJZitWVE30zbDJWd/bzJxgzY0UXm0nP9qLEJt wxmWlfCd1KiOnaFt5m6SBbV6xP1nKR65XqBy6q/pTzyAhQSvr4x9MXW5ZfjXOXthk60qkR ztstMcYsvQeKr+apj2EY+ZqA== Received: from computer ( [10.1.1.1]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id 57c74ce0 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Fri, 28 Jul 2023 18:00:54 +0200 (CEST) From: Manuel Giraud To: Eli Zaretskii Subject: Re: bug#61394: 30.0.50; [PATCH] Image-dired thumb name based on content In-Reply-To: <83bkfwjkh8.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 28 Jul 2023 15:20:35 +0300") References: <874jruy7xx.fsf@ledu-giraud.fr> <83ilg8jzti.fsf@gnu.org> <87k00oo03r.fsf@ledu-giraud.fr> <838rh4jlsq.fsf@gnu.org> <87bklzol8n.fsf@ledu-giraud.fr> <877cwmo8ij.fsf@ledu-giraud.fr> <87y1oz54bn.fsf@ledu-giraud.fr> <87wn4dra0h.fsf@ledu-giraud.fr> <87bklhtwhd.fsf@ledu-giraud.fr> <871qgumqh7.fsf@ledu-giraud.fr> <83ila5n8co.fsf@gnu.org> <87fs59qx54.fsf@ledu-giraud.fr> <83wmyll9s5.fsf@gnu.org> <87bkfxcaa2.fsf@ledu-giraud.fr> <83wmykjzji.fsf@gnu.org> <877cqkcrds.fsf@ledu-giraud.fr> <83bkfwjkh8.fsf@gnu.org> Date: Fri, 28 Jul 2023 18:00:52 +0200 Message-ID: <871qgsc9fv.fsf@ledu-giraud.fr> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 61394 Cc: contovob@tcd.ie, stefankangas@gmail.com, 61394@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: [...] >> Yes I think it does. My patch for bug#61394 changes the previous >> behaviour of 'image-dired-thumbnail-storage'. Now >> 'image-dired-thumbnail-storage' defines where (ie. in which directory) >> the thumbnails are stored and I introduce 'image-dired-thumb-naming' >> which tells how thumbnail file ared named (ie. the file name part sans >> directory). >> >> 'image-dired-thumb-naming' is meaning less if >> 'image-dired-thumbnail-storage' is one of the "standard*" method because >> those methods already define storage locations, file names and even >> sizes. But for the "per-directory" method, I'm using >> 'image-dired-thumb-naming'. As we are talking about thumbnail I did not >> think it was a big deal but if it is I can prepare a patch, on top of >> the one in place, and then 'image-dired-thumb-naming' will be used only >> for the "image-dired" storage method. WDYT? > > I don't think I understand all the aspects of this, as I use neither > image-dired nor the thumbnails. But it sounds like an incompatible > change in behavior wrt what we have in Emacs 29? If so, how do we > expect this to work for users who will have configured their Emacs for > some particular storage type, and then upgrade to Emacs 30 when that > is released? Will the existing thumbnails still work for them? Will > Emacs 30 now start storing thumbnails under differently-formatted > names, even though the user didn't change his/her configuration? AFAIU image-dired thumbnails' generation, this will automatically work for users from Emacs 29... but you are right that new thumbnails (with new names) will be generated. This will be true for users of the "per-directory" storage method. This will also be true when one user customize the 'image-dired-thumb-naming' to 'sha1-contents'. > In general, any incompatible change in behavior (if there is indeed > such a change caused by this changeset) is undesirable. So I'd like > first to discuss why there was a need for the behavior change in the > first place. If you talk about the behaviour change for the "per-directory" method, as I said, I can restore it back to what it was. -- Manuel Giraud From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 28 14:43:17 2023 Received: (at 61394) by debbugs.gnu.org; 28 Jul 2023 18:43:17 +0000 Received: from localhost ([127.0.0.1]:46122 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qPSQn-0003FY-CD for submit@debbugs.gnu.org; Fri, 28 Jul 2023 14:43:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47378) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qPSQk-0003FL-JW for 61394@debbugs.gnu.org; Fri, 28 Jul 2023 14:43:15 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qPSQe-0005lz-BU; Fri, 28 Jul 2023 14:43:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=cSfgXzT8sl8YHQ/SeBZY35WbqLu8/8UlbUK95TojXQE=; b=BywXDg8D4f3l Q7ypJ+UaZc8+agwyXAxJFC4edBPFF3SmQDvPHXbNvEl5SN44B5jrEqgg1KxiUZYZMhU6DjCCu7V57 ZELRnURFeu/qLn8ItwxleqQ2N5jyNBjRjQM0VmxP9r8VaI4QCNO7fA79iLzjKLEybjt+Xr88UolV4 wLRU3H7/hODRP3VdgmJy+5GIGh+CV1YXomR9f4Ut74B2xz+DLKlj3Zjj8gYS+GbVGqgGbi+FG7HNU Oh1n2isNbud4SZdAYdEBIu+13tPmJXry4kissBqja+/l5j2GL/Ggmn+rCfZxC8r4/zQk6fzO6S6As m690UTaZo5gNePNmq72AyA==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qPSQd-0000YX-PC; Fri, 28 Jul 2023 14:43:08 -0400 Date: Fri, 28 Jul 2023 21:44:01 +0300 Message-Id: <83y1izj2q6.fsf@gnu.org> From: Eli Zaretskii To: Manuel Giraud In-Reply-To: <871qgsc9fv.fsf@ledu-giraud.fr> (message from Manuel Giraud on Fri, 28 Jul 2023 18:00:52 +0200) Subject: Re: bug#61394: 30.0.50; [PATCH] Image-dired thumb name based on content References: <874jruy7xx.fsf@ledu-giraud.fr> <83ilg8jzti.fsf@gnu.org> <87k00oo03r.fsf@ledu-giraud.fr> <838rh4jlsq.fsf@gnu.org> <87bklzol8n.fsf@ledu-giraud.fr> <877cwmo8ij.fsf@ledu-giraud.fr> <87y1oz54bn.fsf@ledu-giraud.fr> <87wn4dra0h.fsf@ledu-giraud.fr> <87bklhtwhd.fsf@ledu-giraud.fr> <871qgumqh7.fsf@ledu-giraud.fr> <83ila5n8co.fsf@gnu.org> <87fs59qx54.fsf@ledu-giraud.fr> <83wmyll9s5.fsf@gnu.org> <87bkfxcaa2.fsf@ledu-giraud.fr> <83wmykjzji.fsf@gnu.org> <877cqkcrds.fsf@ledu-giraud.fr> <83bkfwjkh8.fsf@gnu.org> <871qgsc9fv.fsf@ledu-giraud.fr> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 61394 Cc: contovob@tcd.ie, stefankangas@gmail.com, 61394@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Manuel Giraud > Cc: stefankangas@gmail.com, contovob@tcd.ie, 61394@debbugs.gnu.org > Date: Fri, 28 Jul 2023 18:00:52 +0200 > > Eli Zaretskii writes: > > > In general, any incompatible change in behavior (if there is indeed > > such a change caused by this changeset) is undesirable. So I'd like > > first to discuss why there was a need for the behavior change in the > > first place. > > If you talk about the behaviour change for the "per-directory" method, > as I said, I can restore it back to what it was. Yes, I think we should do that, thanks. From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 29 05:51:25 2023 Received: (at 61394) by debbugs.gnu.org; 29 Jul 2023 09:51:25 +0000 Received: from localhost ([127.0.0.1]:46448 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qPgbd-0004lJ-9y for submit@debbugs.gnu.org; Sat, 29 Jul 2023 05:51:25 -0400 Received: from ledu-giraud.fr ([51.159.28.247]:42664) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qPgba-0004l6-Lu for 61394@debbugs.gnu.org; Sat, 29 Jul 2023 05:51:24 -0400 DKIM-Signature: v=1; a=ed25519-sha256; c=simple/simple; s=ed25519; bh=U1z/u6nJ UgLTm1ibTW8js9Enf/JFL5E0i8UQcmUa7Pw=; h=date:references:in-reply-to: subject:cc:to:from; d=ledu-giraud.fr; b=//2RHLVgeZLMef1596zQY9VS8Byz57 X0YgFeD5WPGUgQYJV1pnNi+18tD2QWIgqYPcZrntuDB4POoxRJ2MuEDQ== DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=U1z/u6nJUgLTm1ib TW8js9Enf/JFL5E0i8UQcmUa7Pw=; h=date:references:in-reply-to:subject: cc:to:from; d=ledu-giraud.fr; b=sdS8bdZRuZRleNq8uaEExxMci/bi49eGvWwna8 pm7QyM6GPtM/B8Jy+SwUmVl6zAdSFZNHQNYW9SRiOpoYUeOKGaWlObrbd6uk2Ag4l/mpAJ n9HHpZk1eD6p21xE1TokiQn3sWhSu/V+s/RdNVqkgrJ+Dqn3aGKS5kBkermziMJ6uJMFsw 2AzrS+1sOz5PvX5sxDK58/7RCcMiqrK14elEf1a7dCt5CRKuROBLcDGxoEuG73fhEDaOQ1 vlISlEi2fcQIiw7u73t2XRQFU8i5O2LcErcm9kYF5yuL2F1P/JbdH1YKIbTN+PTCPJ8Jga 81FKGP0dAoGTuIL2K+xyrHFQ== Received: from computer ( [10.1.1.1]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id e77a668a (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Sat, 29 Jul 2023 11:51:20 +0200 (CEST) From: Manuel Giraud To: Eli Zaretskii Subject: Re: bug#61394: 30.0.50; [PATCH] Image-dired thumb name based on content In-Reply-To: <83y1izj2q6.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 28 Jul 2023 21:44:01 +0300") References: <874jruy7xx.fsf@ledu-giraud.fr> <838rh4jlsq.fsf@gnu.org> <87bklzol8n.fsf@ledu-giraud.fr> <877cwmo8ij.fsf@ledu-giraud.fr> <87y1oz54bn.fsf@ledu-giraud.fr> <87wn4dra0h.fsf@ledu-giraud.fr> <87bklhtwhd.fsf@ledu-giraud.fr> <871qgumqh7.fsf@ledu-giraud.fr> <83ila5n8co.fsf@gnu.org> <87fs59qx54.fsf@ledu-giraud.fr> <83wmyll9s5.fsf@gnu.org> <87bkfxcaa2.fsf@ledu-giraud.fr> <83wmykjzji.fsf@gnu.org> <877cqkcrds.fsf@ledu-giraud.fr> <83bkfwjkh8.fsf@gnu.org> <871qgsc9fv.fsf@ledu-giraud.fr> <83y1izj2q6.fsf@gnu.org> Date: Sat, 29 Jul 2023 11:51:19 +0200 Message-ID: <87leezhwq0.fsf@ledu-giraud.fr> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 61394 Cc: contovob@tcd.ie, stefankangas@gmail.com, 61394@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Eli Zaretskii writes: [...] >> If you talk about the behaviour change for the "per-directory" method, >> as I said, I can restore it back to what it was. > > Yes, I think we should do that, thanks. Hi Eli, So I think that this patch does that but then 5efc7b22cec should be reverted. I'm not so sure about the 'image-dired-thumb-name' docstring. BTW, I'm not running "make check" often but I have some failures here and there (2 in TRAMP, 2 in EPG...): is it expected? -- Manuel Giraud --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Revert-thumbnail-naming-for-per-directory-storage-me.patch >From f4c3260e982c0ff5f8afc0d80f634d5d3a3f991b Mon Sep 17 00:00:00 2001 From: Manuel Giraud Date: Sat, 29 Jul 2023 10:59:32 +0200 Subject: [PATCH] Revert thumbnail naming for 'per-directory storage method * lisp/image/image-dired-util.el (image-dired-thumb-name): Revert to "filename.thumb.jpg" for 'per-directory storage. * lisp/image/image-dired.el (image-dired-thumbnail-storage): Fix documentation. --- lisp/image/image-dired-util.el | 12 ++++++------ lisp/image/image-dired.el | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lisp/image/image-dired-util.el b/lisp/image/image-dired-util.el index 3f6880fc807..70911bce45a 100644 --- a/lisp/image/image-dired-util.el +++ b/lisp/image/image-dired-util.el @@ -77,8 +77,9 @@ image-dired-thumb-name added to the file name. - Otherwise `image-dired-thumbnail-storage' is used to set the - directory where to store the thumbnail. In this latter case - the name given to the thumbnail depends on the value of + directory where to store the thumbnail. In this latter case, + if `image-dired-thumbnail-storage' is set to `image-dired' the + file name given to the thumbnail depends on the value of `image-dired-thumb-naming'. See also `image-dired-thumbnail-storage' and @@ -99,15 +100,14 @@ image-dired-thumb-name (let ((name (if (eq 'sha1-contents image-dired-thumb-naming) (image-dired-contents-sha1 file) ;; Defaults to SHA-1 of file name - (if (eq 'per-directory image-dired-thumbnail-storage) - (sha1 (file-name-nondirectory file)) - (sha1 file))))) + (sha1 file)))) (cond ((or (eq 'image-dired image-dired-thumbnail-storage) ;; Maintained for backwards compatibility: (eq 'use-image-dired-dir image-dired-thumbnail-storage)) (expand-file-name (format "%s.jpg" name) (image-dired-dir))) ((eq 'per-directory image-dired-thumbnail-storage) - (expand-file-name (format "%s.jpg" name) + (expand-file-name (format "%s.thumb.jpg" + (file-name-nondirectory file)) (expand-file-name ".image-dired" (file-name-directory file))))))))) diff --git a/lisp/image/image-dired.el b/lisp/image/image-dired.el index 96a0c2ef9bc..c5b317e6b2a 100644 --- a/lisp/image/image-dired.el +++ b/lisp/image/image-dired.el @@ -208,8 +208,8 @@ image-dired-thumbnail-storage Set this user option to `per-directory'. -To control the naming of thumbnails for alternatives (2) and (3) -above, customize the value of `image-dired-thumb-naming'. +To control the naming of thumbnails for alternative 2 above, +customize the value of `image-dired-thumb-naming'. To control the default size of thumbnails for alternatives (2) and (3) above, customize the value of `image-dired-thumb-size'. -- 2.40.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 29 06:35:01 2023 Received: (at 61394) by debbugs.gnu.org; 29 Jul 2023 10:35:01 +0000 Received: from localhost ([127.0.0.1]:46475 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qPhHo-00068J-Sn for submit@debbugs.gnu.org; Sat, 29 Jul 2023 06:35:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43860) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qPhHk-000683-5j for 61394@debbugs.gnu.org; Sat, 29 Jul 2023 06:34:59 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qPhHd-0008Ob-QQ; Sat, 29 Jul 2023 06:34:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=XhzE+ZRNh7WjlxBpqlUi6t/Cx6SoQEXh3BsSdryIBi8=; b=j3jC0ki1AE0r AYU9Mfdt7UPK/oemZRuc5jdjU14vLYT18GDWCWU5mJZfoGjq7NDSNQn8Q2bmfJlbKdQd39Vgu+MmL XSasVhBDapsFKOPXHveADpmL1qtF0qwWY5T623oPvjZBeIPCbOlw+CvgR+1aXj6boQIvxTUj2axkO 4XuBbZv3kAsRI60FAcG/MUGbApjgm6bFEg7O0QvhmRKUMnBT9pmsISs9cwFLH6NgpBkSeex6kAiWF kQ2UoAWiolhMQ3Uo88pJoPZoUfxdoI4naLkT1iUfmrJZedLlEd3kCG6u7iPatMJHsSQEKaN+mSPkf Ntc878pfaxdDHD4IJaQUxQ==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qPhHd-0006T4-A4; Sat, 29 Jul 2023 06:34:49 -0400 Date: Sat, 29 Jul 2023 13:34:47 +0300 Message-Id: <83bkfvm2ew.fsf@gnu.org> From: Eli Zaretskii To: Manuel Giraud In-Reply-To: <87leezhwq0.fsf@ledu-giraud.fr> (message from Manuel Giraud on Sat, 29 Jul 2023 11:51:19 +0200) Subject: Re: bug#61394: 30.0.50; [PATCH] Image-dired thumb name based on content References: <874jruy7xx.fsf@ledu-giraud.fr> <838rh4jlsq.fsf@gnu.org> <87bklzol8n.fsf@ledu-giraud.fr> <877cwmo8ij.fsf@ledu-giraud.fr> <87y1oz54bn.fsf@ledu-giraud.fr> <87wn4dra0h.fsf@ledu-giraud.fr> <87bklhtwhd.fsf@ledu-giraud.fr> <871qgumqh7.fsf@ledu-giraud.fr> <83ila5n8co.fsf@gnu.org> <87fs59qx54.fsf@ledu-giraud.fr> <83wmyll9s5.fsf@gnu.org> <87bkfxcaa2.fsf@ledu-giraud.fr> <83wmykjzji.fsf@gnu.org> <877cqkcrds.fsf@ledu-giraud.fr> <83bkfwjkh8.fsf@gnu.org> <871qgsc9fv.fsf@ledu-giraud.fr> <83y1izj2q6.fsf@gnu.org> <87leezhwq0.fsf@ledu-giraud.fr> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 61394 Cc: contovob@tcd.ie, stefankangas@gmail.com, 61394@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Manuel Giraud > Cc: stefankangas@gmail.com, contovob@tcd.ie, 61394@debbugs.gnu.org > Date: Sat, 29 Jul 2023 11:51:19 +0200 > > So I think that this patch does that but then 5efc7b22cec should be > reverted. > > I'm not so sure about the 'image-dired-thumb-name' docstring. Thanks, will look into that soon. > BTW, I'm not running "make check" often but I have some failures here > and there (2 in TRAMP, 2 in EPG...): is it expected? Please report them as separate bugs. From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 29 06:47:51 2023 Received: (at 61394) by debbugs.gnu.org; 29 Jul 2023 10:47:51 +0000 Received: from localhost ([127.0.0.1]:46492 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qPhUF-0006Z1-0H for submit@debbugs.gnu.org; Sat, 29 Jul 2023 06:47:51 -0400 Received: from mout.gmx.net ([212.227.17.21]:54087) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qPhUC-0006Y0-SQ for 61394@debbugs.gnu.org; Sat, 29 Jul 2023 06:47:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1690627660; x=1691232460; i=michael.albinus@gmx.de; bh=L4jxTsDRVA2euOQ2iJqDOElyDiBP0Y5thOc7izW06zE=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=e9s24LVt84c4LNsoGYTiGEaTb7BuvWxMnVvP4MWoNmkamrRKum6D+5tbJBNVYVy0KFE7Mmi 9ztv3aIxEjJcVuOrjGkYWMHZeFsvZ7eE+KddaH9uIlEygUfxm3JCO4QMDd6eEhrjMaGfmZ4oW FwLBT9d9359Oqg7l19YL9nx6NPn3OOmyFa9FNJ1gUrAmG+kYC7//JbcyQ25iiF4IvNcz2+LPT PJ5anVS5ec0FvLtEscPw/SkdKeItpuRnnNlOyrj3ukGj1iqiCSQgu/YNIesgeNLJOoz/p7L6Z 67megVC0DitL9vLr73BvE6gmZY01qFz2zvVBJaSkhLxiWdzcPFKA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from gandalf.gmx.de ([185.89.39.27]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1N6bfq-1pnVyc0GRq-0183qL; Sat, 29 Jul 2023 12:47:40 +0200 From: Michael Albinus To: Manuel Giraud via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Subject: Re: bug#61394: 30.0.50; [PATCH] Image-dired thumb name based on content In-Reply-To: <87leezhwq0.fsf@ledu-giraud.fr> (Manuel Giraud via's message of "Sat, 29 Jul 2023 11:51:19 +0200") References: <874jruy7xx.fsf@ledu-giraud.fr> <87bklzol8n.fsf@ledu-giraud.fr> <877cwmo8ij.fsf@ledu-giraud.fr> <87y1oz54bn.fsf@ledu-giraud.fr> <87wn4dra0h.fsf@ledu-giraud.fr> <87bklhtwhd.fsf@ledu-giraud.fr> <871qgumqh7.fsf@ledu-giraud.fr> <83ila5n8co.fsf@gnu.org> <87fs59qx54.fsf@ledu-giraud.fr> <83wmyll9s5.fsf@gnu.org> <87bkfxcaa2.fsf@ledu-giraud.fr> <83wmykjzji.fsf@gnu.org> <877cqkcrds.fsf@ledu-giraud.fr> <83bkfwjkh8.fsf@gnu.org> <871qgsc9fv.fsf@ledu-giraud.fr> <83y1izj2q6.fsf@gnu.org> <87leezhwq0.fsf@ledu-giraud.fr> Date: Sat, 29 Jul 2023 12:47:38 +0200 Message-ID: <87jzuj5705.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:4+B/UECi8mUKXueVqD3zEcGjnqQQ05E8Q6Gqyxi2wO8nAZ+Od40 Z3Py0JkhuH3eTRcf347nZC3jvBDLQzAxqi8mkY5y2KMlXeacmYbernlR5EPGo7TGTySxqtu RD9cPTIJ9Fl1de9aUAc62Fko8arXAsHxgwajgPD2OBm6/esrrUEZIZ32HVjuDMZmbNAc/Sl JI1KRC5WpV09IWFe/3xgw== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:PgLmxn1tT7g=;PLyuNUMPc9hM3IXepDPoW/Z8jBX v6e1o9VqZZa3XJHIfUONRiOzbN0woRs1s8vrzcU/D8X14g2CxgGlaMhZoBDCFl/5JBw9s3JhD 4S/Wi12XqebBCbmDqz3+xpduW8E4k0ZOI5ZUBs8nUDBOuW6IuEbPptTkyr2a8BJzc98ML6pX+ 5mElwALdyeqv75md5W7+TSas+pfurGhJGIjhdZMzHKqyN/yooxnAyA+Vy+VpHinAci/TXa/zF vzlM4OX9RI9Ov5aZbJWREmA2XtBh7NZAkUURE8zMMMUnB4WpKkeVM9d51WnmOTz/8s3CbPi26 PEQlrh/xufX87hAi6jBWb/lKE6RS6W5kfLr+gF8N3xpLzd7vYgrK9xnxflHP2YAFqF2sdhfIc eE1KhNgd4kPCxadhpUrPw45JM6CfVzI5VKGyW7bVUKfAcLNB6d92/XaNfBBv+AvI0iz4sMDX8 WjMZpwYQUqi1PmO8H0NpgPkMj3zvowLjUfIiATsrbvg5EJ9hEg+fzQpBuKbzXJFRGhN87JYd+ 61pa3Xr5VKL6WhHCEnmZE1B9OLLSt5prkvlEZxEKz666PMRLw597pW4MiqAVlX+ycNTvEkPIP zKMazeJKdHGBH65PtQtTq3ZSn++2yDV4xXdU7axxoqvqOnf9CyG5pdwPZuCwOQ1Nz4fkcPFEG XjGSegmND9NqBQiNwySye+hhbA2h63kPGaZskoh7fjOx/n6U4vGv17hV6a2DwrAEJFqN+oVEL csdsGi//G7Z33cL2KweOR1hve0itU8l856HCA3e/QLfjWnkDDFAx/rbw7p3B9dMLmaM7rQyYt Qgm7Bwg6nsqupT4UNYX1OGgraRlbGJRPJKClYzRrDLs4KdkTAHpwmSqeGpIePcnwT7Jp+Z3XX 3Mz7mFAEIt5m69dZZyMBx3UTgc4Am3K8GPU2+sgBChvbLlIxNAtef7N6yjUVKoZAWufmUe9WJ zKnd4w== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 61394 Cc: contovob@tcd.ie, 61394@debbugs.gnu.org, Eli Zaretskii , stefankangas@gmail.com, Manuel Giraud X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Manuel Giraud via "Bug reports for GNU Emacs, the Swiss army knife of text editors" writes: Hi Manuel, > BTW, I'm not running "make check" often but I have some failures here > and there (2 in TRAMP, 2 in EPG...): is it expected? No (speaking for Tramp). Could you pls show them? Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 29 12:50:35 2023 Received: (at 61394) by debbugs.gnu.org; 29 Jul 2023 16:50:35 +0000 Received: from localhost ([127.0.0.1]:48705 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qPn9G-00055w-Kl for submit@debbugs.gnu.org; Sat, 29 Jul 2023 12:50:35 -0400 Received: from ledu-giraud.fr ([51.159.28.247]:45537) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qPn9C-00055m-QQ for 61394@debbugs.gnu.org; Sat, 29 Jul 2023 12:50:32 -0400 DKIM-Signature: v=1; a=ed25519-sha256; c=simple/simple; s=ed25519; bh=cfHiBnq+ 7/j+fnSbZnUK2fiY2XuoWySCw5MPOXVgpAA=; h=date:references:in-reply-to: subject:cc:to:from; d=ledu-giraud.fr; b=VqUuJc2X3cndSkffM2qYj9HkingEfL 2gXotrkhdjdOyKP0valzaA6aVv2cgz1qWhQmdvUWczdB/fSUSci9NMBw== DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=cfHiBnq+7/j+fnSb ZnUK2fiY2XuoWySCw5MPOXVgpAA=; h=date:references:in-reply-to:subject: cc:to:from; d=ledu-giraud.fr; b=a492jFZnuPNMzifcm4Nrruht/bYMaxx2pAbpfh 8bjknbyD+PBYXtx5WleMsNaE4tGPs4g0OnKdFv85dGGJJXFMfA5iaN/qUWnkpRLWBFsdMK oz9DO/KWLHaPkkKc+NapeNf0Yfgxqj8BWh0wL5B0VLaYOp6SqP0JeiiKSJu0z3cJzTRZHP +9strJhwr7+jFPyj2VpRYBFjgF2ZPV7Haebl+Lnfd/beasRQPvGKnGT2xK9ArHa69eabbd r2MQL4Tx0HPGRqWeuISlrym1ijZOjIv7BGAt1F2L96Kn69KCxMheaHnB13G79rpLrG0UWr dfHVF9FpSZv4a/qzhaBxTaCg== Received: from computer ( [10.1.1.1]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id 4a54f5c5 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Sat, 29 Jul 2023 18:50:29 +0200 (CEST) From: Manuel Giraud To: Eli Zaretskii Subject: Re: bug#61394: 30.0.50; [PATCH] Image-dired thumb name based on content In-Reply-To: <83bkfvm2ew.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 29 Jul 2023 13:34:47 +0300") References: <874jruy7xx.fsf@ledu-giraud.fr> <877cwmo8ij.fsf@ledu-giraud.fr> <87y1oz54bn.fsf@ledu-giraud.fr> <87wn4dra0h.fsf@ledu-giraud.fr> <87bklhtwhd.fsf@ledu-giraud.fr> <871qgumqh7.fsf@ledu-giraud.fr> <83ila5n8co.fsf@gnu.org> <87fs59qx54.fsf@ledu-giraud.fr> <83wmyll9s5.fsf@gnu.org> <87bkfxcaa2.fsf@ledu-giraud.fr> <83wmykjzji.fsf@gnu.org> <877cqkcrds.fsf@ledu-giraud.fr> <83bkfwjkh8.fsf@gnu.org> <871qgsc9fv.fsf@ledu-giraud.fr> <83y1izj2q6.fsf@gnu.org> <87leezhwq0.fsf@ledu-giraud.fr> <83bkfvm2ew.fsf@gnu.org> Date: Sat, 29 Jul 2023 18:50:27 +0200 Message-ID: <87cz0airvw.fsf@ledu-giraud.fr> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 61394 Cc: contovob@tcd.ie, stefankangas@gmail.com, 61394@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Eli Zaretskii writes: >> From: Manuel Giraud >> Cc: stefankangas@gmail.com, contovob@tcd.ie, 61394@debbugs.gnu.org >> Date: Sat, 29 Jul 2023 11:51:19 +0200 >> >> So I think that this patch does that but then 5efc7b22cec should be >> reverted. >> >> I'm not so sure about the 'image-dired-thumb-name' docstring. > > Thanks, will look into that soon. Here is a new version of this patch. I missed some precision in a docstring in the previous one (sorry). --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Revert-thumbnail-naming-for-per-directory-storage-me.patch >From 9db8988412a8d2463d3d44ff23b80e545e9e5b19 Mon Sep 17 00:00:00 2001 From: Manuel Giraud Date: Sat, 29 Jul 2023 10:59:32 +0200 Subject: [PATCH] Revert thumbnail naming for 'per-directory storage method * lisp/image/image-dired-util.el (image-dired-thumb-name): Revert to "filename.thumb.jpg" for 'per-directory storage. * lisp/image/image-dired.el (image-dired-thumbnail-storage): Fix documentation. --- lisp/image/image-dired-util.el | 12 ++++++------ lisp/image/image-dired.el | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lisp/image/image-dired-util.el b/lisp/image/image-dired-util.el index 3f6880fc807..70911bce45a 100644 --- a/lisp/image/image-dired-util.el +++ b/lisp/image/image-dired-util.el @@ -77,8 +77,9 @@ image-dired-thumb-name added to the file name. - Otherwise `image-dired-thumbnail-storage' is used to set the - directory where to store the thumbnail. In this latter case - the name given to the thumbnail depends on the value of + directory where to store the thumbnail. In this latter case, + if `image-dired-thumbnail-storage' is set to `image-dired' the + file name given to the thumbnail depends on the value of `image-dired-thumb-naming'. See also `image-dired-thumbnail-storage' and @@ -99,15 +100,14 @@ image-dired-thumb-name (let ((name (if (eq 'sha1-contents image-dired-thumb-naming) (image-dired-contents-sha1 file) ;; Defaults to SHA-1 of file name - (if (eq 'per-directory image-dired-thumbnail-storage) - (sha1 (file-name-nondirectory file)) - (sha1 file))))) + (sha1 file)))) (cond ((or (eq 'image-dired image-dired-thumbnail-storage) ;; Maintained for backwards compatibility: (eq 'use-image-dired-dir image-dired-thumbnail-storage)) (expand-file-name (format "%s.jpg" name) (image-dired-dir))) ((eq 'per-directory image-dired-thumbnail-storage) - (expand-file-name (format "%s.jpg" name) + (expand-file-name (format "%s.thumb.jpg" + (file-name-nondirectory file)) (expand-file-name ".image-dired" (file-name-directory file))))))))) diff --git a/lisp/image/image-dired.el b/lisp/image/image-dired.el index 96a0c2ef9bc..98596510ec1 100644 --- a/lisp/image/image-dired.el +++ b/lisp/image/image-dired.el @@ -174,8 +174,8 @@ image-dired-thumb-naming In both case, a \"jpg\" extension is appended to save as JPEG. The value of this option is ignored if Image-Dired is customized -to use the Thumbnail Managing Standard. See -`image-dired-thumbnail-storage'." +to use the Thumbnail Managing Standard or the per-directory +thumbnails setting. See `image-dired-thumbnail-storage'." :type '(choice :tag "How to name thumbnail files" (const :tag "SHA-1 of the image file name" sha1-filename) (const :tag "SHA-1 of the image contents" sha1-contents)) @@ -208,8 +208,8 @@ image-dired-thumbnail-storage Set this user option to `per-directory'. -To control the naming of thumbnails for alternatives (2) and (3) -above, customize the value of `image-dired-thumb-naming'. +To control the naming of thumbnails for alternative (2) above, +customize the value of `image-dired-thumb-naming'. To control the default size of thumbnails for alternatives (2) and (3) above, customize the value of `image-dired-thumb-size'. -- 2.40.0 --=-=-= Content-Type: text/plain >> BTW, I'm not running "make check" often but I have some failures here >> and there (2 in TRAMP, 2 in EPG...): is it expected? > > Please report them as separate bugs. Ok, I've created one for Tramp for the moment. -- Manuel Giraud --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 31 11:53:08 2023 Received: (at 61394) by debbugs.gnu.org; 31 Jul 2023 15:53:08 +0000 Received: from localhost ([127.0.0.1]:53308 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qQVCl-0003hM-TK for submit@debbugs.gnu.org; Mon, 31 Jul 2023 11:53:08 -0400 Received: from ledu-giraud.fr ([51.159.28.247]:17564) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qQVCj-0003hD-82 for 61394@debbugs.gnu.org; Mon, 31 Jul 2023 11:53:06 -0400 DKIM-Signature: v=1; a=ed25519-sha256; c=simple/simple; s=ed25519; bh=VZIRK/+6 lx89kt7FQdFc++FMjfOKy+sZtoOFisPeAIM=; h=date:references:in-reply-to: subject:cc:to:from; d=ledu-giraud.fr; b=NaKWPF8retDV6rysualQyk+Po2Qt4t YQK1D3p9E7CH/RkDt+wb93FekuuTgLYMq8mquQGZI9Sa5HlJvGY5yHDw== DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=VZIRK/+6lx89kt7F QdFc++FMjfOKy+sZtoOFisPeAIM=; h=date:references:in-reply-to:subject: cc:to:from; d=ledu-giraud.fr; b=fHPi+oBSpZav1OcZ6ycbhRRTQQuDI9hB0VWELz AlByQ8452lu7Z77WvgMMv/VLdvGZdrVFO+qBSW5DNHd9tPwdTYkLfoW6x2ei3vSo/rINKZ Ab/bjt1UxKS4ElOpAAsjIAThU9MffcySfi97yYFJ0g1TjRE4RgLVcO7iM2K8ygU6tjL1Xn UMtt/BlNzjk43Swd0YHQZGTLa7CVReG3nfgGIBztCTodc6jkJuM6dh5RFzj2ZaPxYm23ay BV+sFsV6gF4UUjP3Ok1ukftY3Fjsi09Hc8gRJsKPCEd9aVnxvLWfyTgPmdUujsq2ud3uqN ihjT++TPPKPCpRcx+smZwbAA== Received: from computer ( [10.1.1.1]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id 8da80668 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Mon, 31 Jul 2023 17:53:03 +0200 (CEST) From: Manuel Giraud To: Eli Zaretskii Subject: Re: bug#61394: 30.0.50; [PATCH] Image-dired thumb name based on content In-Reply-To: <87leezhwq0.fsf@ledu-giraud.fr> (Manuel Giraud's message of "Sat, 29 Jul 2023 11:51:19 +0200") References: <874jruy7xx.fsf@ledu-giraud.fr> <87bklzol8n.fsf@ledu-giraud.fr> <877cwmo8ij.fsf@ledu-giraud.fr> <87y1oz54bn.fsf@ledu-giraud.fr> <87wn4dra0h.fsf@ledu-giraud.fr> <87bklhtwhd.fsf@ledu-giraud.fr> <871qgumqh7.fsf@ledu-giraud.fr> <83ila5n8co.fsf@gnu.org> <87fs59qx54.fsf@ledu-giraud.fr> <83wmyll9s5.fsf@gnu.org> <87bkfxcaa2.fsf@ledu-giraud.fr> <83wmykjzji.fsf@gnu.org> <877cqkcrds.fsf@ledu-giraud.fr> <83bkfwjkh8.fsf@gnu.org> <871qgsc9fv.fsf@ledu-giraud.fr> <83y1izj2q6.fsf@gnu.org> <87leezhwq0.fsf@ledu-giraud.fr> Date: Mon, 31 Jul 2023 17:53:01 +0200 Message-ID: <87edko9ixu.fsf@ledu-giraud.fr> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 61394 Cc: contovob@tcd.ie, stefankangas@gmail.com, 61394@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi, FTR, there is a thing that does not work with this "thumb name based on content": upon rotation the thumb is not updated properly. This comes from the fact that the image content has changed (obviously) so the new thumb will have a new name and is not displayed in the *image-dired* buffer =F0=9F=98=85. I'd have to find a way around it. --=20 Manuel Giraud From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 01 13:06:00 2023 Received: (at 61394) by debbugs.gnu.org; 1 Aug 2023 17:06:00 +0000 Received: from localhost ([127.0.0.1]:48263 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qQsop-0004Tl-PC for submit@debbugs.gnu.org; Tue, 01 Aug 2023 13:06:00 -0400 Received: from ledu-giraud.fr ([51.159.28.247]:37519) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qQsom-0004Ta-E3 for 61394@debbugs.gnu.org; Tue, 01 Aug 2023 13:05:57 -0400 DKIM-Signature: v=1; a=ed25519-sha256; c=simple/simple; s=ed25519; bh=hNUiLpqC 6+/GanByU1cumACdDczqUIIGZ6n8Hg5PySw=; h=date:references:in-reply-to: subject:cc:to:from; d=ledu-giraud.fr; b=vOA8s7mSdclAlMPlZ6PsXoyVQmXjD0 koTINveqIj2gnnxU83qz8apCHGaqNV5Aiy3J/Yds1BH2Nc3UWZa6LaAA== DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=hNUiLpqC6+/GanBy U1cumACdDczqUIIGZ6n8Hg5PySw=; h=date:references:in-reply-to:subject: cc:to:from; d=ledu-giraud.fr; b=WpUhWXM7uYdOQ4krMr1T+FgyqNPDfztNdvUDIx bGipGlU9Nfi3eydNzEHa9pk1MiyBt98Kx3Wz76uQFfqTm1LlxK/ovsADJXT+E7RjKg/nlw YZvSkLLNPO04CuVaOHypVYkvSkzENTot/qZOZXTo3xZtdDY7BbEUAmtss0LnFMlnrdXYy2 ZOaQMuFQlItUIkS7yynVuGnoUSt8npJsASJNZYFL2OVTn51yZeIL2ZbeKJ1SWRFh98SOOx TFHbtWc/r2/l4/RAMKDNXZN4t87YD30+rmVHS7+XT6vKXJnoepHbMQsU5ICQZVLbS+Paf8 Gu+yt3gYVhcCP75cOJ8vgbhQ== Received: from computer ( [10.1.1.1]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id 338ec390 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 1 Aug 2023 19:05:53 +0200 (CEST) From: Manuel Giraud To: Eli Zaretskii Subject: Re: bug#61394: 30.0.50; [PATCH] Image-dired thumb name based on content In-Reply-To: <87edko9ixu.fsf@ledu-giraud.fr> (Manuel Giraud's message of "Mon, 31 Jul 2023 17:53:01 +0200") References: <874jruy7xx.fsf@ledu-giraud.fr> <877cwmo8ij.fsf@ledu-giraud.fr> <87y1oz54bn.fsf@ledu-giraud.fr> <87wn4dra0h.fsf@ledu-giraud.fr> <87bklhtwhd.fsf@ledu-giraud.fr> <871qgumqh7.fsf@ledu-giraud.fr> <83ila5n8co.fsf@gnu.org> <87fs59qx54.fsf@ledu-giraud.fr> <83wmyll9s5.fsf@gnu.org> <87bkfxcaa2.fsf@ledu-giraud.fr> <83wmykjzji.fsf@gnu.org> <877cqkcrds.fsf@ledu-giraud.fr> <83bkfwjkh8.fsf@gnu.org> <871qgsc9fv.fsf@ledu-giraud.fr> <83y1izj2q6.fsf@gnu.org> <87leezhwq0.fsf@ledu-giraud.fr> <87edko9ixu.fsf@ledu-giraud.fr> Date: Tue, 01 Aug 2023 19:05:52 +0200 Message-ID: <87h6piu1zj.fsf@ledu-giraud.fr> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 61394 Cc: contovob@tcd.ie, stefankangas@gmail.com, 61394@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Manuel Giraud writes: > Hi, > > FTR, there is a thing that does not work with this "thumb name based on > content": upon rotation the thumb is not updated properly. > > This comes from the fact that the image content has changed (obviously) > so the new thumb will have a new name and is not displayed in the > *image-dired* buffer =F0=9F=98=85. I'd have to find a way around it. Hi, So here is a patch that fixes this issue. Thanks. --=20 Manuel Giraud --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Fix-thumbnail-update-when-thumb-name-is-based-on-ima.patch >From 5716e77a61a7a7459a00e266c4d6236be48c02c4 Mon Sep 17 00:00:00 2001 From: Manuel Giraud Date: Tue, 1 Aug 2023 18:56:33 +0200 Subject: [PATCH] Fix thumbnail update when thumb name is based on image content * lisp/image/image-dired-util.el (image-dired-update-thumbnail-at-point): New function to update thumbnail when original image contents changed. * lisp/image/image-dired-external.el (image-dired-rotate-original): Use it. * lisp/image/image-dired.el (image-dired-display-thumbs): Fix spacing while here. --- lisp/image/image-dired-external.el | 3 ++- lisp/image/image-dired-util.el | 15 +++++++++++++++ lisp/image/image-dired.el | 2 +- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/lisp/image/image-dired-external.el b/lisp/image/image-dired-external.el index 9f35e17a7e6..77352c25a3b 100644 --- a/lisp/image/image-dired-external.el +++ b/lisp/image/image-dired-external.el @@ -405,7 +405,8 @@ image-dired-rotate-original (not image-dired-rotate-original-ask-before-overwrite)) (progn (copy-file image-dired-temp-rotate-image-file file t) - (image-dired-refresh-thumb)) + (image-dired-refresh-thumb) + (image-dired-update-thumbnail-at-point)) (image-dired-display-image file)))))) diff --git a/lisp/image/image-dired-util.el b/lisp/image/image-dired-util.el index 3f6880fc807..1114f50477c 100644 --- a/lisp/image/image-dired-util.el +++ b/lisp/image/image-dired-util.el @@ -190,6 +190,21 @@ image-dired-image-at-point-p "Return non-nil if there is an `image-dired' thumbnail at point." (get-text-property (point) 'image-dired-thumbnail)) +(defun image-dired-update-thumbnail-at-point () + "Update the thumbnail at point if the original image file has been +modified. Take care of uncaching and removing the old thumbnail +file." + (when (image-dired-image-at-point-p) + (let* ((file (image-dired-original-file-name)) + (thumb (expand-file-name (image-dired-thumb-name file))) + (image (get-text-property (point) 'display))) + (when image + (let ((old-thumb (plist-get (cdr image) :file))) + (unless (string= thumb old-thumb) + (clear-image-cache old-thumb) + (delete-file old-thumb) + (setf (plist-get (cdr image) :file) thumb))))))) + (defun image-dired-window-width-pixels (window) "Calculate WINDOW width in pixels." (declare (obsolete window-body-width "29.1")) diff --git a/lisp/image/image-dired.el b/lisp/image/image-dired.el index 96a0c2ef9bc..7b0059e2f7a 100644 --- a/lisp/image/image-dired.el +++ b/lisp/image/image-dired.el @@ -590,7 +590,7 @@ image-dired-display-thumbs `image-dired-previous-line-and-display' where we do not want the thumbnail buffer to be selected." (interactive "P" nil dired-mode) - (setq image-dired--generate-thumbs-start (current-time)) + (setq image-dired--generate-thumbs-start (current-time)) (let ((buf (image-dired-create-thumbnail-buffer)) files dired-buf) (if arg -- 2.40.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 02 07:42:23 2023 Received: (at 61394) by debbugs.gnu.org; 2 Aug 2023 11:42:23 +0000 Received: from localhost ([127.0.0.1]:48982 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qRAFD-0002Zk-9a for submit@debbugs.gnu.org; Wed, 02 Aug 2023 07:42:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58694) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qRAFA-0002ZU-1S for 61394@debbugs.gnu.org; Wed, 02 Aug 2023 07:42:21 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRAF3-0004vQ-Is; Wed, 02 Aug 2023 07:42:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=xwq08HAyMLFBNw1Fzx1E2IKI/xpfnAQL1La963WrDvs=; b=TUoUmvZeojXxyZemO140 0h76L8O61PLJhmtPiTvFt4uWpPsQzYdcupTM2v1ts5PBttkfe1/wUruz60dw/ilLil6iBmQF5ioUv GWulSF+j97z+m1GrRwNzAzkWY7ZoLNyPWiAuzoaf0zTgLHn1dQQTv7jqW009zwQu+cBz4o8Q4hhNz NCCO/tO+bBjq+kBftj/pD2/eGXAi0nCN60SKUTK/qvOWMTbwDb9xaXKIbJzICFwbSQmLrhp+xdvsG pG3DwCa31BOnxlaqV1sRDJFEZbKSVzwQqpn4GpDXgwPqjbKSHAWJTMzHkj3jLmIcxrHqJNKthcCgZ dOM7r17CsvaxxQ==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRAF3-00044I-2P; Wed, 02 Aug 2023 07:42:13 -0400 Date: Wed, 02 Aug 2023 14:42:20 +0300 Message-Id: <83wmydzn4z.fsf@gnu.org> From: Eli Zaretskii To: Manuel Giraud In-Reply-To: <87h6piu1zj.fsf@ledu-giraud.fr> (message from Manuel Giraud on Tue, 01 Aug 2023 19:05:52 +0200) Subject: Re: bug#61394: 30.0.50; [PATCH] Image-dired thumb name based on content References: <874jruy7xx.fsf@ledu-giraud.fr> <877cwmo8ij.fsf@ledu-giraud.fr> <87y1oz54bn.fsf@ledu-giraud.fr> <87wn4dra0h.fsf@ledu-giraud.fr> <87bklhtwhd.fsf@ledu-giraud.fr> <871qgumqh7.fsf@ledu-giraud.fr> <83ila5n8co.fsf@gnu.org> <87fs59qx54.fsf@ledu-giraud.fr> <83wmyll9s5.fsf@gnu.org> <87bkfxcaa2.fsf@ledu-giraud.fr> <83wmykjzji.fsf@gnu.org> <877cqkcrds.fsf@ledu-giraud.fr> <83bkfwjkh8.fsf@gnu.org> <871qgsc9fv.fsf@ledu-giraud.fr> <83y1izj2q6.fsf@gnu.org> <87leezhwq0.fsf@ledu-giraud.fr> <87edko9ixu.fsf@ledu-giraud.fr> <87h6piu1zj.fsf@ledu-giraud.fr> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 61394 Cc: contovob@tcd.ie, stefankangas@gmail.com, 61394@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Manuel Giraud > Cc: stefankangas@gmail.com, contovob@tcd.ie, 61394@debbugs.gnu.org > Date: Tue, 01 Aug 2023 19:05:52 +0200 > > Manuel Giraud writes: > > > Hi, > > > > FTR, there is a thing that does not work with this "thumb name based on > > content": upon rotation the thumb is not updated properly. > > > > This comes from the fact that the image content has changed (obviously) > > so the new thumb will have a new name and is not displayed in the > > *image-dired* buffer 😅. I'd have to find a way around it. > > Hi, > > So here is a patch that fixes this issue. Thanks. Thanks. Maybe I'm missing something, but isn't the problem limited to just one method of naming the thumbnail files? If so, shouldn't these changes be limited to that method alone? From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 02 14:00:29 2023 Received: (at 61394) by debbugs.gnu.org; 2 Aug 2023 18:00:29 +0000 Received: from localhost ([127.0.0.1]:50122 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qRG97-00077M-Gk for submit@debbugs.gnu.org; Wed, 02 Aug 2023 14:00:29 -0400 Received: from ledu-giraud.fr ([51.159.28.247]:12362) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qRG91-000777-75 for 61394@debbugs.gnu.org; Wed, 02 Aug 2023 14:00:27 -0400 DKIM-Signature: v=1; a=ed25519-sha256; c=simple/simple; s=ed25519; bh=V5StUMRW wSfRmNPKgyGznme67TC8LRUYZJtSbsO4fco=; h=date:references:in-reply-to: subject:cc:to:from; d=ledu-giraud.fr; b=se38i9YaiKPIPWuPXefnIoNJXzZMto 2xqwHoTjhd8Zl3qgnQBNDsIPyJWUXQpGSXtWvFPH7zHEwLd5cBcYv/DQ== DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=V5StUMRWwSfRmNPK gyGznme67TC8LRUYZJtSbsO4fco=; h=date:references:in-reply-to:subject: cc:to:from; d=ledu-giraud.fr; b=CYJOdAZXDj9dvq1igTt+Ir/IrDorS00M9wdSnh AS+pUAfmTXQYw6mY3z1xQgRsADUDzqLBV45MEgiuk6nRxB9hB49FCZbpjXu6QdKaHa8x4G 2q/MO6v520Nrz96/fOv8YAF93iEmQcUWCEaXdBtuDhb7WM37jjq/bBRcq1Wr3HeN4+PSKk v1Cs0GtsSxNKdAjF90gPkWsm92ivvKp5yb5YLANwusABdA6Yp40SVlGFX4j6qlp/hbV+Df aeZCdm0awn4zuegS6RtZ+cqOdioePLGYiHmRQyrGMY4ao7ozTq7YvPRjjnsA6yA8h5jjrb AuW6wQI09k/CL0oxNVEaPgqQ== Received: from computer ( [10.1.1.1]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id ddfb2f5b (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 2 Aug 2023 20:00:21 +0200 (CEST) From: Manuel Giraud To: Eli Zaretskii Subject: Re: bug#61394: 30.0.50; [PATCH] Image-dired thumb name based on content In-Reply-To: <83wmydzn4z.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 02 Aug 2023 14:42:20 +0300") References: <874jruy7xx.fsf@ledu-giraud.fr> <87y1oz54bn.fsf@ledu-giraud.fr> <87wn4dra0h.fsf@ledu-giraud.fr> <87bklhtwhd.fsf@ledu-giraud.fr> <871qgumqh7.fsf@ledu-giraud.fr> <83ila5n8co.fsf@gnu.org> <87fs59qx54.fsf@ledu-giraud.fr> <83wmyll9s5.fsf@gnu.org> <87bkfxcaa2.fsf@ledu-giraud.fr> <83wmykjzji.fsf@gnu.org> <877cqkcrds.fsf@ledu-giraud.fr> <83bkfwjkh8.fsf@gnu.org> <871qgsc9fv.fsf@ledu-giraud.fr> <83y1izj2q6.fsf@gnu.org> <87leezhwq0.fsf@ledu-giraud.fr> <87edko9ixu.fsf@ledu-giraud.fr> <87h6piu1zj.fsf@ledu-giraud.fr> <83wmydzn4z.fsf@gnu.org> Date: Wed, 02 Aug 2023 20:00:19 +0200 Message-ID: <87sf91jpe4.fsf@ledu-giraud.fr> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 61394 Cc: contovob@tcd.ie, stefankangas@gmail.com, 61394@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: >> From: Manuel Giraud >> Cc: stefankangas@gmail.com, contovob@tcd.ie, 61394@debbugs.gnu.org >> Date: Tue, 01 Aug 2023 19:05:52 +0200 >>=20 >> Manuel Giraud writes: >>=20 >> > Hi, >> > >> > FTR, there is a thing that does not work with this "thumb name based on >> > content": upon rotation the thumb is not updated properly. >> > >> > This comes from the fact that the image content has changed (obviously) >> > so the new thumb will have a new name and is not displayed in the >> > *image-dired* buffer =F0=9F=98=85. I'd have to find a way around it. >>=20 >> Hi, >>=20 >> So here is a patch that fixes this issue. Thanks. > > Thanks. Maybe I'm missing something, but isn't the problem limited to > just one method of naming the thumbnail files? If so, shouldn't these > changes be limited to that method alone? Yes. First I had a test about the method around the call to 'image-dired-update-thumbnail-at-point' but then I realize that nothing will be done for others methods as I'm doing a test on the thumb name change: ... (unless (string=3D thumb old-thumb) ... --=20 Manuel Giraud From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 02 14:16:56 2023 Received: (at 61394) by debbugs.gnu.org; 2 Aug 2023 18:16:56 +0000 Received: from localhost ([127.0.0.1]:50142 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qRGP2-0007aV-1U for submit@debbugs.gnu.org; Wed, 02 Aug 2023 14:16:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39090) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qRGOy-0007aE-1J for 61394@debbugs.gnu.org; Wed, 02 Aug 2023 14:16:55 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRGOr-0002NU-Px; Wed, 02 Aug 2023 14:16:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=+JGfhqS6FRRTpYlorLkVKkz8veUMzqVNsTktwS5IN+0=; b=aEhj837mo3/M X35dQPSwMj4xzaeM/8LFhLgBVct2VgVUbsM0sF0ze8D86QYHtNaadLngUuK//R0tvR4qir2vU2rWB 8xz7B8eIeC7VbhTbzqtdhPXlknmBj4mCWyjoGlmF7TcD8ftvyaORygmgrapQfOymOtxKrN23iVuMK ooMeFbxX+FauqbCHvbVeNCtvRSA9zZ36AzpNLhdVR6/R3PMXsRPXJEF4v6W5V7o8vzWqGJmCr+QTY 7cpHzm9W7dZHzQdB3y9kZj3KFLoFMs0sI1HVkgoUdrsjaAdX7npIVbd70aikRSwTHMX0BdX1jAkif FC1EXND8zJ+pdXtN140URg==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRGOq-0006BS-Ux; Wed, 02 Aug 2023 14:16:45 -0400 Date: Wed, 02 Aug 2023 21:16:53 +0300 Message-Id: <83a5v9z4ve.fsf@gnu.org> From: Eli Zaretskii To: Manuel Giraud In-Reply-To: <87sf91jpe4.fsf@ledu-giraud.fr> (message from Manuel Giraud on Wed, 02 Aug 2023 20:00:19 +0200) Subject: Re: bug#61394: 30.0.50; [PATCH] Image-dired thumb name based on content References: <874jruy7xx.fsf@ledu-giraud.fr> <87y1oz54bn.fsf@ledu-giraud.fr> <87wn4dra0h.fsf@ledu-giraud.fr> <87bklhtwhd.fsf@ledu-giraud.fr> <871qgumqh7.fsf@ledu-giraud.fr> <83ila5n8co.fsf@gnu.org> <87fs59qx54.fsf@ledu-giraud.fr> <83wmyll9s5.fsf@gnu.org> <87bkfxcaa2.fsf@ledu-giraud.fr> <83wmykjzji.fsf@gnu.org> <877cqkcrds.fsf@ledu-giraud.fr> <83bkfwjkh8.fsf@gnu.org> <871qgsc9fv.fsf@ledu-giraud.fr> <83y1izj2q6.fsf@gnu.org> <87leezhwq0.fsf@ledu-giraud.fr> <87edko9ixu.fsf@ledu-giraud.fr> <87h6piu1zj.fsf@ledu-giraud.fr> <83wmydzn4z.fsf@gnu.org> <87sf91jpe4.fsf@ledu-giraud.fr> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 61394 Cc: contovob@tcd.ie, stefankangas@gmail.com, 61394@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Manuel Giraud > Cc: stefankangas@gmail.com, contovob@tcd.ie, 61394@debbugs.gnu.org > Date: Wed, 02 Aug 2023 20:00:19 +0200 > > Eli Zaretskii writes: > > > Thanks. Maybe I'm missing something, but isn't the problem limited to > > just one method of naming the thumbnail files? If so, shouldn't these > > changes be limited to that method alone? > > Yes. First I had a test about the method around the call to > 'image-dired-update-thumbnail-at-point' but then I realize that nothing > will be done for others methods as I'm doing a test on the thumb name > change: > ... (unless (string= thumb old-thumb) ... This at least warrants a comment, so that others won't have to be bothered by the same questions. From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 03 04:43:54 2023 Received: (at 61394) by debbugs.gnu.org; 3 Aug 2023 08:43:54 +0000 Received: from localhost ([127.0.0.1]:50807 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qRTw2-0002t8-61 for submit@debbugs.gnu.org; Thu, 03 Aug 2023 04:43:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35904) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qRTvy-0002ss-F6 for 61394@debbugs.gnu.org; Thu, 03 Aug 2023 04:43:52 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRTvs-0008Kr-2C; Thu, 03 Aug 2023 04:43:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=UiQbRWL0SBNJEvjTns/8uwdT3B6AN3qfpBt+F2YyXS0=; b=foBCgFmu4UhS 2bt5uNoXDApwoI9TUP4Adn+x96nUrEWM6FWAJDTKAixUBX8nOb80yXaXwrR4ZR9NMoiJ2V03TLNcZ BEysAhanEQHlKIXmsHyX173PLMTQJiVv6HBy1D3iQJhq4MDhVkYv/dtfJcXq9QpLh2IIyIlt0Ec1G v2saC+YtOtIfY3Ch7pTRDdOTc8Y8xsWzEoZ4BYj5sxSHF8pyyw6cPhs0ZB8WPlcvGYJ9QURY6m+4i vdHhb5iJmfSRNSCdRV7lB1gvjI8F/meCZzPFv9v14pKSTWPujOb+pIvFQzXtAaDUZ2jmeQ4S+IwA6 cDoUVXnubjO3f4JrqKOZ/g==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRTvo-00010Z-Ox; Thu, 03 Aug 2023 04:43:41 -0400 Date: Thu, 03 Aug 2023 11:43:49 +0300 Message-Id: <83il9wy0qi.fsf@gnu.org> From: Eli Zaretskii To: Manuel Giraud In-Reply-To: <87cz0airvw.fsf@ledu-giraud.fr> (message from Manuel Giraud on Sat, 29 Jul 2023 18:50:27 +0200) Subject: Re: bug#61394: 30.0.50; [PATCH] Image-dired thumb name based on content References: <874jruy7xx.fsf@ledu-giraud.fr> <877cwmo8ij.fsf@ledu-giraud.fr> <87y1oz54bn.fsf@ledu-giraud.fr> <87wn4dra0h.fsf@ledu-giraud.fr> <87bklhtwhd.fsf@ledu-giraud.fr> <871qgumqh7.fsf@ledu-giraud.fr> <83ila5n8co.fsf@gnu.org> <87fs59qx54.fsf@ledu-giraud.fr> <83wmyll9s5.fsf@gnu.org> <87bkfxcaa2.fsf@ledu-giraud.fr> <83wmykjzji.fsf@gnu.org> <877cqkcrds.fsf@ledu-giraud.fr> <83bkfwjkh8.fsf@gnu.org> <871qgsc9fv.fsf@ledu-giraud.fr> <83y1izj2q6.fsf@gnu.org> <87leezhwq0.fsf@ledu-giraud.fr> <83bkfvm2ew.fsf@gnu.org> <87cz0airvw.fsf@ledu-giraud.fr> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 61394 Cc: contovob@tcd.ie, stefankangas@gmail.com, 61394@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Manuel Giraud > Cc: stefankangas@gmail.com, contovob@tcd.ie, 61394@debbugs.gnu.org > Date: Sat, 29 Jul 2023 18:50:27 +0200 > > Eli Zaretskii writes: > > >> From: Manuel Giraud > >> Cc: stefankangas@gmail.com, contovob@tcd.ie, 61394@debbugs.gnu.org > >> Date: Sat, 29 Jul 2023 11:51:19 +0200 > >> > >> So I think that this patch does that but then 5efc7b22cec should be > >> reverted. > >> > >> I'm not so sure about the 'image-dired-thumb-name' docstring. > > > > Thanks, will look into that soon. > > Here is a new version of this patch. I missed some precision in a > docstring in the previous one (sorry). Thanks, installed on the master branch. From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 03 07:10:49 2023 Received: (at 61394) by debbugs.gnu.org; 3 Aug 2023 11:10:49 +0000 Received: from localhost ([127.0.0.1]:50952 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qRWEC-00074p-Kd for submit@debbugs.gnu.org; Thu, 03 Aug 2023 07:10:49 -0400 Received: from ledu-giraud.fr ([51.159.28.247]:12670) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qRWEA-00074h-Ma for 61394@debbugs.gnu.org; Thu, 03 Aug 2023 07:10:48 -0400 DKIM-Signature: v=1; a=ed25519-sha256; c=simple/simple; s=ed25519; bh=CQaSBwRI T+BuXwNoxlDpKqiNSjlRQpwaOxwXB3narlU=; h=date:references:in-reply-to: subject:cc:to:from; d=ledu-giraud.fr; b=wp0KCz8Em9CJimpSFYKCbBT1nqO6wH wLfxCyCEONdVjWcJ2Hz9MuLmTnpNSwhlxkXV11Erd/TMLOaW6MDaJqCw== DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=CQaSBwRIT+BuXwNo xlDpKqiNSjlRQpwaOxwXB3narlU=; h=date:references:in-reply-to:subject: cc:to:from; d=ledu-giraud.fr; b=P0KKcDP4AVKz+Xgs/GaHew1PGnNz++f5+5ymPh AW/RH0eSeWdwafzKiEJwE2IQEXgg2kXV5+hX+/99vSYaXNFSqu23fYIFGYEjD2E9S+W85S uf5j2rI9oi3ueUHfkqxW1SeJBLJyWxjXBe961SUgM6VRzSUAqMZ0nQGdTqOuGfAQiBptZ9 AQQP4uD6JqNrUq8tFsHLyGU/y5+l2PWf/kYl3XYh8hwrxKxXR5Kg8XKmctjFGzHT0Z+N3U lh/eJyIElfqPlV9ldBjHQr9erj0MPOOP4Nww7maG20CIACnYfFws/cPX5MI2aoP3+gyTdV faxDfo20VkQym39DVCVsnXwA== Received: from computer ( [10.1.1.1]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id 502e5f3a (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Thu, 3 Aug 2023 13:10:45 +0200 (CEST) From: Manuel Giraud To: Eli Zaretskii Subject: Re: bug#61394: 30.0.50; [PATCH] Image-dired thumb name based on content In-Reply-To: <83a5v9z4ve.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 02 Aug 2023 21:16:53 +0300") References: <874jruy7xx.fsf@ledu-giraud.fr> <87wn4dra0h.fsf@ledu-giraud.fr> <87bklhtwhd.fsf@ledu-giraud.fr> <871qgumqh7.fsf@ledu-giraud.fr> <83ila5n8co.fsf@gnu.org> <87fs59qx54.fsf@ledu-giraud.fr> <83wmyll9s5.fsf@gnu.org> <87bkfxcaa2.fsf@ledu-giraud.fr> <83wmykjzji.fsf@gnu.org> <877cqkcrds.fsf@ledu-giraud.fr> <83bkfwjkh8.fsf@gnu.org> <871qgsc9fv.fsf@ledu-giraud.fr> <83y1izj2q6.fsf@gnu.org> <87leezhwq0.fsf@ledu-giraud.fr> <87edko9ixu.fsf@ledu-giraud.fr> <87h6piu1zj.fsf@ledu-giraud.fr> <83wmydzn4z.fsf@gnu.org> <87sf91jpe4.fsf@ledu-giraud.fr> <83a5v9z4ve.fsf@gnu.org> Date: Thu, 03 Aug 2023 13:10:43 +0200 Message-ID: <87o7jojs98.fsf@ledu-giraud.fr> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 61394 Cc: contovob@tcd.ie, stefankangas@gmail.com, 61394@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Eli Zaretskii writes: >> From: Manuel Giraud >> Cc: stefankangas@gmail.com, contovob@tcd.ie, 61394@debbugs.gnu.org >> Date: Wed, 02 Aug 2023 20:00:19 +0200 >> >> Eli Zaretskii writes: >> >> > Thanks. Maybe I'm missing something, but isn't the problem limited to >> > just one method of naming the thumbnail files? If so, shouldn't these >> > changes be limited to that method alone? >> >> Yes. First I had a test about the method around the call to >> 'image-dired-update-thumbnail-at-point' but then I realize that nothing >> will be done for others methods as I'm doing a test on the thumb name >> change: >> ... (unless (string= thumb old-thumb) ... > > This at least warrants a comment, so that others won't have to be > bothered by the same questions. What about this one? I've also permuted some instructions to avoid a flicker when updating the thumbnail. -- Manuel Giraud --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Fix-thumbnail-update-when-thumb-name-is-based-on-ima.patch >From 4759066712e9cec4906f95a96b3c6b023149eade Mon Sep 17 00:00:00 2001 From: Manuel Giraud Date: Tue, 1 Aug 2023 18:56:33 +0200 Subject: [PATCH] Fix thumbnail update when thumb name is based on image content * lisp/image/image-dired-util.el (image-dired-update-thumbnail-at-point): New function to update thumbnail when original image contents changed. * lisp/image/image-dired-external.el (image-dired-rotate-original): Use it. * lisp/image/image-dired.el (image-dired-display-thumbs): Fix spacing while here. --- lisp/image/image-dired-external.el | 3 ++- lisp/image/image-dired-util.el | 18 ++++++++++++++++++ lisp/image/image-dired.el | 2 +- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/lisp/image/image-dired-external.el b/lisp/image/image-dired-external.el index 9f35e17a7e6..77352c25a3b 100644 --- a/lisp/image/image-dired-external.el +++ b/lisp/image/image-dired-external.el @@ -405,7 +405,8 @@ image-dired-rotate-original (not image-dired-rotate-original-ask-before-overwrite)) (progn (copy-file image-dired-temp-rotate-image-file file t) - (image-dired-refresh-thumb)) + (image-dired-refresh-thumb) + (image-dired-update-thumbnail-at-point)) (image-dired-display-image file)))))) diff --git a/lisp/image/image-dired-util.el b/lisp/image/image-dired-util.el index 70911bce45a..40e90e6dcb8 100644 --- a/lisp/image/image-dired-util.el +++ b/lisp/image/image-dired-util.el @@ -190,6 +190,24 @@ image-dired-image-at-point-p "Return non-nil if there is an `image-dired' thumbnail at point." (get-text-property (point) 'image-dired-thumbnail)) +(defun image-dired-update-thumbnail-at-point () + "Update the thumbnail at point if the original image file has been +modified. Take care of uncaching and removing the old thumbnail +file." + (when (image-dired-image-at-point-p) + (let* ((file (image-dired-original-file-name)) + (thumb (expand-file-name (image-dired-thumb-name file))) + (image (get-text-property (point) 'display))) + (when image + (let ((old-thumb (plist-get (cdr image) :file))) + ;; If 'thumb' and 'old-thumb' are the same file names, do + ;; nothing. This would be the case when + ;; 'image-dired-thumb-naming' is set to 'sha1-filename'. + (unless (string= thumb old-thumb) + (setf (plist-get (cdr image) :file) thumb) + (clear-image-cache old-thumb) + (delete-file old-thumb))))))) + (defun image-dired-window-width-pixels (window) "Calculate WINDOW width in pixels." (declare (obsolete window-body-width "29.1")) diff --git a/lisp/image/image-dired.el b/lisp/image/image-dired.el index 98596510ec1..33beb5b3e49 100644 --- a/lisp/image/image-dired.el +++ b/lisp/image/image-dired.el @@ -590,7 +590,7 @@ image-dired-display-thumbs `image-dired-previous-line-and-display' where we do not want the thumbnail buffer to be selected." (interactive "P" nil dired-mode) - (setq image-dired--generate-thumbs-start (current-time)) + (setq image-dired--generate-thumbs-start (current-time)) (let ((buf (image-dired-create-thumbnail-buffer)) files dired-buf) (if arg -- 2.40.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 03 07:38:14 2023 Received: (at 61394) by debbugs.gnu.org; 3 Aug 2023 11:38:14 +0000 Received: from localhost ([127.0.0.1]:50984 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qRWej-0001zE-L6 for submit@debbugs.gnu.org; Thu, 03 Aug 2023 07:38:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43690) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qRWeh-0001z1-LT for 61394@debbugs.gnu.org; Thu, 03 Aug 2023 07:38:13 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRWeb-0002f6-Dx; Thu, 03 Aug 2023 07:38:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=fg5IMeMihjyAduYeFs44+VyJXR9iitBwpEHFP7jPtiE=; b=bkFQadxpbm8C C3srC5ZPLXj6h3+YhsVJo9HpyEqfSOZsOpn+4ifxjyAPPXZ3mJ1JTSReKUd04fE6FWU1YpDmFbX+f OQXR1yGnUzOYyeI7UVrGoiv6DgilhqDSiK5N69ruPn5G8mmI/f/9t7lBYG6z1JdpUG9uBpTpyp0/j HgxGnKR+vNpVV1frflS/vaKRT/UT0U0P496Kba3pCLgsJ4esMvOzk65dsX+HlI7kO4Zctmv1lJQ7y aHQtHtFkrKs2K5wYX4ZGEbBDJ9GI8r2AK9DnfDwyJi0xigz9FevHoEz0hiVhZmP3WnY84uR2dhliz o77G3Nc4ZGikY6cqDypbwA==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRWea-0004ab-SP; Thu, 03 Aug 2023 07:38:05 -0400 Date: Thu, 03 Aug 2023 14:38:14 +0300 Message-Id: <833510xsnt.fsf@gnu.org> From: Eli Zaretskii To: Manuel Giraud In-Reply-To: <87o7jojs98.fsf@ledu-giraud.fr> (message from Manuel Giraud on Thu, 03 Aug 2023 13:10:43 +0200) Subject: Re: bug#61394: 30.0.50; [PATCH] Image-dired thumb name based on content References: <874jruy7xx.fsf@ledu-giraud.fr> <87wn4dra0h.fsf@ledu-giraud.fr> <87bklhtwhd.fsf@ledu-giraud.fr> <871qgumqh7.fsf@ledu-giraud.fr> <83ila5n8co.fsf@gnu.org> <87fs59qx54.fsf@ledu-giraud.fr> <83wmyll9s5.fsf@gnu.org> <87bkfxcaa2.fsf@ledu-giraud.fr> <83wmykjzji.fsf@gnu.org> <877cqkcrds.fsf@ledu-giraud.fr> <83bkfwjkh8.fsf@gnu.org> <871qgsc9fv.fsf@ledu-giraud.fr> <83y1izj2q6.fsf@gnu.org> <87leezhwq0.fsf@ledu-giraud.fr> <87edko9ixu.fsf@ledu-giraud.fr> <87h6piu1zj.fsf@ledu-giraud.fr> <83wmydzn4z.fsf@gnu.org> <87sf91jpe4.fsf@ledu-giraud.fr> <83a5v9z4ve.fsf@gnu.org> <87o7jojs98.fsf@ledu-giraud.fr> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 61394 Cc: contovob@tcd.ie, stefankangas@gmail.com, 61394@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Manuel Giraud > Cc: stefankangas@gmail.com, contovob@tcd.ie, 61394@debbugs.gnu.org > Date: Thu, 03 Aug 2023 13:10:43 +0200 > > Eli Zaretskii writes: > > >> Yes. First I had a test about the method around the call to > >> 'image-dired-update-thumbnail-at-point' but then I realize that nothing > >> will be done for others methods as I'm doing a test on the thumb name > >> change: > >> ... (unless (string= thumb old-thumb) ... > > > > This at least warrants a comment, so that others won't have to be > > bothered by the same questions. > > What about this one? I've also permuted some instructions to avoid a > flicker when updating the thumbnail. Thanks, a few minor comments below: > +(defun image-dired-update-thumbnail-at-point () > + "Update the thumbnail at point if the original image file has been > +modified. Take care of uncaching and removing the old thumbnail > +file." The first line of the doc string should be a single complete sentence. (Just move the "modified" part to the first line, I think there's enough space there.) > + (when (image-dired-image-at-point-p) > + (let* ((file (image-dired-original-file-name)) > + (thumb (expand-file-name (image-dired-thumb-name file))) > + (image (get-text-property (point) 'display))) > + (when image > + (let ((old-thumb (plist-get (cdr image) :file))) > + ;; If 'thumb' and 'old-thumb' are the same file names, do > + ;; nothing. This would be the case when > + ;; 'image-dired-thumb-naming' is set to 'sha1-filename'. Isn't that true for _any_ method except the single one for which you need this patch? I thought only names based on SHA1 of the contents are affected and need this additional renaming? The comment seems to say something else. From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 03 12:51:34 2023 Received: (at 61394) by debbugs.gnu.org; 3 Aug 2023 16:51:34 +0000 Received: from localhost ([127.0.0.1]:52819 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qRbXy-0002uM-1v for submit@debbugs.gnu.org; Thu, 03 Aug 2023 12:51:34 -0400 Received: from ledu-giraud.fr ([51.159.28.247]:41971) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qRbXv-0002uA-GF for 61394@debbugs.gnu.org; Thu, 03 Aug 2023 12:51:32 -0400 DKIM-Signature: v=1; a=ed25519-sha256; c=simple/simple; s=ed25519; bh=IaMgoOem PcwbnjQOW73Qqqu1AzsFAyT+/GWxF+8HaGI=; h=date:references:in-reply-to: subject:cc:to:from; d=ledu-giraud.fr; b=/zQe3sqsszSzC9j+znSE0mOuXUA8WH k13aDm9LMBR2OIGbKVYoiGgjlgN4fJ53jiEkzAxBY3ZXe1dBpQDqezDw== DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=IaMgoOemPcwbnjQO W73Qqqu1AzsFAyT+/GWxF+8HaGI=; h=date:references:in-reply-to:subject: cc:to:from; d=ledu-giraud.fr; b=I3HjcZGUx98A0HfqDnAJC+xuNH2L1OL64Z38o+ Q3+HSez1fsYjOj6XFORUZLnBjECkoBOvSoVApkua5bmCwqLXUbzgEYfrXR1Xyt0iFASjw+ bpM2hl5X62VlyPVYUNchY+GEguRgStzOdNIFTi3HoH//fk7JcL4lc3zMzqNMOV/AcxWSDF if9jhLwgDANuHzJMPvC9XQvyXNhNfqIIMavUh6y/rEUyTmdHzutAdm6aPXGf3PUoKilXT7 MYV0Uzf3WyElSt0afLZN4xcpm2rL1Zh1/VUIb6qfb3w+2c7aFM05wEi+o2hdnQUfkQ9Ipn yG6s3rek7qyHgONtRtIg9NCQ== Received: from computer ( [10.1.1.1]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id 979f90be (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Thu, 3 Aug 2023 18:51:29 +0200 (CEST) From: Manuel Giraud To: Eli Zaretskii Subject: Re: bug#61394: 30.0.50; [PATCH] Image-dired thumb name based on content In-Reply-To: <833510xsnt.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 03 Aug 2023 14:38:14 +0300") References: <874jruy7xx.fsf@ledu-giraud.fr> <87bklhtwhd.fsf@ledu-giraud.fr> <871qgumqh7.fsf@ledu-giraud.fr> <83ila5n8co.fsf@gnu.org> <87fs59qx54.fsf@ledu-giraud.fr> <83wmyll9s5.fsf@gnu.org> <87bkfxcaa2.fsf@ledu-giraud.fr> <83wmykjzji.fsf@gnu.org> <877cqkcrds.fsf@ledu-giraud.fr> <83bkfwjkh8.fsf@gnu.org> <871qgsc9fv.fsf@ledu-giraud.fr> <83y1izj2q6.fsf@gnu.org> <87leezhwq0.fsf@ledu-giraud.fr> <87edko9ixu.fsf@ledu-giraud.fr> <87h6piu1zj.fsf@ledu-giraud.fr> <83wmydzn4z.fsf@gnu.org> <87sf91jpe4.fsf@ledu-giraud.fr> <83a5v9z4ve.fsf@gnu.org> <87o7jojs98.fsf@ledu-giraud.fr> <833510xsnt.fsf@gnu.org> Date: Thu, 03 Aug 2023 18:51:28 +0200 Message-ID: <87jzucjchb.fsf@ledu-giraud.fr> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 61394 Cc: contovob@tcd.ie, stefankangas@gmail.com, 61394@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: [...] >> +(defun image-dired-update-thumbnail-at-point () >> + "Update the thumbnail at point if the original image file has been >> +modified. Take care of uncaching and removing the old thumbnail >> +file." > > The first line of the doc string should be a single complete sentence. > (Just move the "modified" part to the first line, I think there's > enough space there.) I don't understand. "Update the thumbnail at point." does not seem sufficient because the fact that the original image might be modified is the main point of this function. >> + (when (image-dired-image-at-point-p) >> + (let* ((file (image-dired-original-file-name)) >> + (thumb (expand-file-name (image-dired-thumb-name file))) >> + (image (get-text-property (point) 'display))) >> + (when image >> + (let ((old-thumb (plist-get (cdr image) :file))) >> + ;; If 'thumb' and 'old-thumb' are the same file names, do >> + ;; nothing. This would be the case when >> + ;; 'image-dired-thumb-naming' is set to 'sha1-filename'. > > Isn't that true for _any_ method except the single one for which you > need this patch? I thought only names based on SHA1 of the contents > are affected and need this additional renaming? The comment seems to > say something else. What about: "When 'image-dired-thumb-naming' is set to 'sha1-contents', 'thumb' and 'old-thumb' could be different file names. Update the thumbnail then." -- Manuel Giraud From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 03 14:30:33 2023 Received: (at 61394) by debbugs.gnu.org; 3 Aug 2023 18:30:33 +0000 Received: from localhost ([127.0.0.1]:52921 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qRd5k-0005Xw-Ru for submit@debbugs.gnu.org; Thu, 03 Aug 2023 14:30:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46812) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qRd5i-0005Xi-3l for 61394@debbugs.gnu.org; Thu, 03 Aug 2023 14:30:31 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRd5c-0008Lk-5A; Thu, 03 Aug 2023 14:30:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=i6VNvehQLvr5hp+6q0SQvRzQREN2ZZXUwElQ+nrG86w=; b=jjXGFFMRI8xg yi04K7dd01/285eBQ6ltL6303Ep4OykvA0d4QZlH2xBTkOD6l9LEc0HACRBU4aES9FmaUBgPnpLIS Fk8Xt5e5LVzqcG4HqB2StxfNap0RhCTLdai5cGE0xBm3GGXztS6ETyZ+KLjtL3f2Z0Wy0v9xez1/1 8U5wOcw3hFqN5GaKERNguerOU4sCawxGBfKBzvCstPIKwjOr0WoNOJtFGQRNmVlrWbMFt4bxQc0V+ B3kciYtrghuXMP37RO2T6KSXb9t6acgzdxooxtwGasPOGMMgCsrg394wOvnNSslhHIyF6UR0C9adA 30aL/FE1ZvR1ywpfEtQLGw==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRd5a-0002IJ-P0; Thu, 03 Aug 2023 14:30:23 -0400 Date: Thu, 03 Aug 2023 21:30:33 +0300 Message-Id: <83sf90vv06.fsf@gnu.org> From: Eli Zaretskii To: Manuel Giraud In-Reply-To: <87jzucjchb.fsf@ledu-giraud.fr> (message from Manuel Giraud on Thu, 03 Aug 2023 18:51:28 +0200) Subject: Re: bug#61394: 30.0.50; [PATCH] Image-dired thumb name based on content References: <874jruy7xx.fsf@ledu-giraud.fr> <87bklhtwhd.fsf@ledu-giraud.fr> <871qgumqh7.fsf@ledu-giraud.fr> <83ila5n8co.fsf@gnu.org> <87fs59qx54.fsf@ledu-giraud.fr> <83wmyll9s5.fsf@gnu.org> <87bkfxcaa2.fsf@ledu-giraud.fr> <83wmykjzji.fsf@gnu.org> <877cqkcrds.fsf@ledu-giraud.fr> <83bkfwjkh8.fsf@gnu.org> <871qgsc9fv.fsf@ledu-giraud.fr> <83y1izj2q6.fsf@gnu.org> <87leezhwq0.fsf@ledu-giraud.fr> <87edko9ixu.fsf@ledu-giraud.fr> <87h6piu1zj.fsf@ledu-giraud.fr> <83wmydzn4z.fsf@gnu.org> <87sf91jpe4.fsf@ledu-giraud.fr> <83a5v9z4ve.fsf@gnu.org> <87o7jojs98.fsf@ledu-giraud.fr> <833510xsnt.fsf@gnu.org> <87jzucjchb.fsf@ledu-giraud.fr> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 61394 Cc: contovob@tcd.ie, stefankangas@gmail.com, 61394@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Manuel Giraud > Cc: stefankangas@gmail.com, contovob@tcd.ie, 61394@debbugs.gnu.org > Date: Thu, 03 Aug 2023 18:51:28 +0200 > > Eli Zaretskii writes: > > >> +(defun image-dired-update-thumbnail-at-point () > >> + "Update the thumbnail at point if the original image file has been > >> +modified. Take care of uncaching and removing the old thumbnail > >> +file." > > > > The first line of the doc string should be a single complete sentence. > > (Just move the "modified" part to the first line, I think there's > > enough space there.) > > I don't understand. "Update the thumbnail at point." does not seem > sufficient because the fact that the original image might be modified is > the main point of this function. What I had in mind is this: (defun image-dired-update-thumbnail-at-point () "Update the thumbnail at point if the original image file has been modified. This function uncaches and removes the thumbnail file under the old name." OK? > What about: > > "When 'image-dired-thumb-naming' is set to 'sha1-contents', 'thumb' and > 'old-thumb' could be different file names. Update the thumbnail then." Much better, thanks. From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 04 03:44:48 2023 Received: (at 61394) by debbugs.gnu.org; 4 Aug 2023 07:44:48 +0000 Received: from localhost ([127.0.0.1]:53352 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qRpUN-00014f-Pe for submit@debbugs.gnu.org; Fri, 04 Aug 2023 03:44:48 -0400 Received: from ledu-giraud.fr ([51.159.28.247]:6245) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qRpUK-00014V-8H for 61394@debbugs.gnu.org; Fri, 04 Aug 2023 03:44:46 -0400 DKIM-Signature: v=1; a=ed25519-sha256; c=simple/simple; s=ed25519; bh=JiSDIthH Hz5+95JEBdtY+altVT9Eh3Gl/uWpmi49dRY=; h=date:references:in-reply-to: subject:cc:to:from; d=ledu-giraud.fr; b=Xrj7x6zUlI3BhczZWFIwWduI6bK/3q obXxl/DzoUkCDWOUSwPA3Q4UYEmGUed2ykQ77PqqWki9t/oHX/M4VlDA== DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=JiSDIthHHz5+95JE BdtY+altVT9Eh3Gl/uWpmi49dRY=; h=date:references:in-reply-to:subject: cc:to:from; d=ledu-giraud.fr; b=XnSI5/xR9F6J+amSKveEHRsQs3koJ+XC8WBLYo IS9rbY87VOtTbCbszD0kD6pNsssWPaOiddIP/n+Dfj6bH0IGd1uZHFZlgS5C56zEsvTKMe 2BZUjB52wtv1P811IHJpAO4EEorzEdXfwq14qQNb4EuliabpaXYJ0nmUK3ag33JKhpXQ1w RKO26BbTGE5vLG3PzeG5K3VCUQdq6c6NYbU2ni2aGtJNHoh9AxX/2hLqLi4dF1JlkhAEHC wjXmTET7ZfLMOPeACyMQwHaAqKSHi/86PL+c6whw9tsAA2YzIC2YTlLVboGvpxYJ3SLhgp b7JZbgofauyBTMX9gKR+W6ow== Received: from computer ( [10.1.1.1]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id 00da3dc8 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Fri, 4 Aug 2023 09:44:42 +0200 (CEST) From: Manuel Giraud To: Eli Zaretskii Subject: Re: bug#61394: 30.0.50; [PATCH] Image-dired thumb name based on content In-Reply-To: <83sf90vv06.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 03 Aug 2023 21:30:33 +0300") References: <874jruy7xx.fsf@ledu-giraud.fr> <871qgumqh7.fsf@ledu-giraud.fr> <83ila5n8co.fsf@gnu.org> <87fs59qx54.fsf@ledu-giraud.fr> <83wmyll9s5.fsf@gnu.org> <87bkfxcaa2.fsf@ledu-giraud.fr> <83wmykjzji.fsf@gnu.org> <877cqkcrds.fsf@ledu-giraud.fr> <83bkfwjkh8.fsf@gnu.org> <871qgsc9fv.fsf@ledu-giraud.fr> <83y1izj2q6.fsf@gnu.org> <87leezhwq0.fsf@ledu-giraud.fr> <87edko9ixu.fsf@ledu-giraud.fr> <87h6piu1zj.fsf@ledu-giraud.fr> <83wmydzn4z.fsf@gnu.org> <87sf91jpe4.fsf@ledu-giraud.fr> <83a5v9z4ve.fsf@gnu.org> <87o7jojs98.fsf@ledu-giraud.fr> <833510xsnt.fsf@gnu.org> <87jzucjchb.fsf@ledu-giraud.fr> <83sf90vv06.fsf@gnu.org> Date: Fri, 04 Aug 2023 09:44:41 +0200 Message-ID: <87bkfnjlp2.fsf@ledu-giraud.fr> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 61394 Cc: contovob@tcd.ie, stefankangas@gmail.com, 61394@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Eli Zaretskii writes: >> From: Manuel Giraud >> Cc: stefankangas@gmail.com, contovob@tcd.ie, 61394@debbugs.gnu.org >> Date: Thu, 03 Aug 2023 18:51:28 +0200 >> >> Eli Zaretskii writes: >> >> >> +(defun image-dired-update-thumbnail-at-point () >> >> + "Update the thumbnail at point if the original image file has been >> >> +modified. Take care of uncaching and removing the old thumbnail >> >> +file." >> > >> > The first line of the doc string should be a single complete sentence. >> > (Just move the "modified" part to the first line, I think there's >> > enough space there.) >> >> I don't understand. "Update the thumbnail at point." does not seem >> sufficient because the fact that the original image might be modified is >> the main point of this function. > > What I had in mind is this: > > (defun image-dired-update-thumbnail-at-point () > "Update the thumbnail at point if the original image file has been modified. > This function uncaches and removes the thumbnail file under the old name." > > OK? Ok. Sorry I misread your reply ("move" not "remove"). BTW, I'm using 'M-q' on docstring and my fill-column is set to 70 (the default I guess): is there a better way? >> What about: >> >> "When 'image-dired-thumb-naming' is set to 'sha1-contents', 'thumb' and >> 'old-thumb' could be different file names. Update the thumbnail then." > > Much better, thanks. Ok, so here is a new patch. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Fix-thumbnail-update-when-thumb-name-is-based-on-ima.patch >From b67f344f148dbabf8f2c0099aa9002af4570c5dd Mon Sep 17 00:00:00 2001 From: Manuel Giraud Date: Tue, 1 Aug 2023 18:56:33 +0200 Subject: [PATCH] Fix thumbnail update when thumb name is based on image content * lisp/image/image-dired-util.el (image-dired-update-thumbnail-at-point): New function to update thumbnail when original image contents changed. * lisp/image/image-dired-external.el (image-dired-rotate-original): Use it. * lisp/image/image-dired.el (image-dired-display-thumbs): Fix spacing while here. --- lisp/image/image-dired-external.el | 3 ++- lisp/image/image-dired-util.el | 17 +++++++++++++++++ lisp/image/image-dired.el | 2 +- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/lisp/image/image-dired-external.el b/lisp/image/image-dired-external.el index 9f35e17a7e6..77352c25a3b 100644 --- a/lisp/image/image-dired-external.el +++ b/lisp/image/image-dired-external.el @@ -405,7 +405,8 @@ image-dired-rotate-original (not image-dired-rotate-original-ask-before-overwrite)) (progn (copy-file image-dired-temp-rotate-image-file file t) - (image-dired-refresh-thumb)) + (image-dired-refresh-thumb) + (image-dired-update-thumbnail-at-point)) (image-dired-display-image file)))))) diff --git a/lisp/image/image-dired-util.el b/lisp/image/image-dired-util.el index 70911bce45a..53a5e274175 100644 --- a/lisp/image/image-dired-util.el +++ b/lisp/image/image-dired-util.el @@ -190,6 +190,23 @@ image-dired-image-at-point-p "Return non-nil if there is an `image-dired' thumbnail at point." (get-text-property (point) 'image-dired-thumbnail)) +(defun image-dired-update-thumbnail-at-point () + "Update the thumbnail at point if the original image file has been modified. +This function uncaches and removes the thumbnail file under the old name." + (when (image-dired-image-at-point-p) + (let* ((file (image-dired-original-file-name)) + (thumb (expand-file-name (image-dired-thumb-name file))) + (image (get-text-property (point) 'display))) + (when image + (let ((old-thumb (plist-get (cdr image) :file))) + ;; When 'image-dired-thumb-naming' is set to + ;; 'sha1-contents', 'thumb' and 'old-thumb' could be + ;; different file names. Update the thumbnail then. + (unless (string= thumb old-thumb) + (setf (plist-get (cdr image) :file) thumb) + (clear-image-cache old-thumb) + (delete-file old-thumb))))))) + (defun image-dired-window-width-pixels (window) "Calculate WINDOW width in pixels." (declare (obsolete window-body-width "29.1")) diff --git a/lisp/image/image-dired.el b/lisp/image/image-dired.el index 98596510ec1..33beb5b3e49 100644 --- a/lisp/image/image-dired.el +++ b/lisp/image/image-dired.el @@ -590,7 +590,7 @@ image-dired-display-thumbs `image-dired-previous-line-and-display' where we do not want the thumbnail buffer to be selected." (interactive "P" nil dired-mode) - (setq image-dired--generate-thumbs-start (current-time)) + (setq image-dired--generate-thumbs-start (current-time)) (let ((buf (image-dired-create-thumbnail-buffer)) files dired-buf) (if arg -- 2.40.0 --=-=-= Content-Type: text/plain -- Manuel Giraud --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 04 06:55:22 2023 Received: (at 61394) by debbugs.gnu.org; 4 Aug 2023 10:55:22 +0000 Received: from localhost ([127.0.0.1]:53480 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qRsSo-0006CS-4w for submit@debbugs.gnu.org; Fri, 04 Aug 2023 06:55:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56922) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qRsSj-0006C9-7h for 61394@debbugs.gnu.org; Fri, 04 Aug 2023 06:55:20 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRsSd-0001bC-Fz; Fri, 04 Aug 2023 06:55:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=6DtWohh2QJH/ewi0HvjSOOeQt9XXL39/7DL4KVBPSAo=; b=g62jo/BMknEZ 6g/cka78aES6R4NAzEKI28a7vbPlJEUSRrTj7gYeXaZpIa8f1ugjpiyBkl5BWzLhPGbkT7QVt8O9q wvTCG1q0nKuIwmdc/qXAkNPsZ70QMd7q13QVV7JgFPtnloDDGFzRU7IXCytmynBUBlckbmfYO5dr4 M6XuSjpBtwoC4eKSlm6qsymPZGY4H83LbeTR9qibj+34FE3etK3CXzs6vwPM/FhLmFujf8NCbGfWU Xi0/ky5PDu91MyoOB9bUSn5nCjwbQUjUfwTBItTL90/UJFFfC1pfYIt70NDRIXyvoWXtrfN+r/Weg OpaBjc/SGaMTktdqa4rvuA==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRsSc-0008Om-VU; Fri, 04 Aug 2023 06:55:11 -0400 Date: Fri, 04 Aug 2023 13:55:22 +0300 Message-Id: <83zg37ulet.fsf@gnu.org> From: Eli Zaretskii To: Manuel Giraud In-Reply-To: <87bkfnjlp2.fsf@ledu-giraud.fr> (message from Manuel Giraud on Fri, 04 Aug 2023 09:44:41 +0200) Subject: Re: bug#61394: 30.0.50; [PATCH] Image-dired thumb name based on content References: <874jruy7xx.fsf@ledu-giraud.fr> <871qgumqh7.fsf@ledu-giraud.fr> <83ila5n8co.fsf@gnu.org> <87fs59qx54.fsf@ledu-giraud.fr> <83wmyll9s5.fsf@gnu.org> <87bkfxcaa2.fsf@ledu-giraud.fr> <83wmykjzji.fsf@gnu.org> <877cqkcrds.fsf@ledu-giraud.fr> <83bkfwjkh8.fsf@gnu.org> <871qgsc9fv.fsf@ledu-giraud.fr> <83y1izj2q6.fsf@gnu.org> <87leezhwq0.fsf@ledu-giraud.fr> <87edko9ixu.fsf@ledu-giraud.fr> <87h6piu1zj.fsf@ledu-giraud.fr> <83wmydzn4z.fsf@gnu.org> <87sf91jpe4.fsf@ledu-giraud.fr> <83a5v9z4ve.fsf@gnu.org> <87o7jojs98.fsf@ledu-giraud.fr> <833510xsnt.fsf@gnu.org> <87jzucjchb.fsf@ledu-giraud.fr> <83sf90vv06.fsf@gnu.org> <87bkfnjlp2.fsf@ledu-giraud.fr> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 61394 Cc: contovob@tcd.ie, stefankangas@gmail.com, 61394@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Manuel Giraud > Cc: stefankangas@gmail.com, contovob@tcd.ie, 61394@debbugs.gnu.org > Date: Fri, 04 Aug 2023 09:44:41 +0200 > > > What I had in mind is this: > > > > (defun image-dired-update-thumbnail-at-point () > > "Update the thumbnail at point if the original image file has been modified. > > This function uncaches and removes the thumbnail file under the old name." > > > > OK? > > Ok. Sorry I misread your reply ("move" not "remove"). BTW, I'm using > 'M-q' on docstring and my fill-column is set to 70 (the default I > guess): is there a better way? 70 is okay as the default value, but when you cannot squeeze the first line into 70 columns, it is okay to use up to 79. > >> What about: > >> > >> "When 'image-dired-thumb-naming' is set to 'sha1-contents', 'thumb' and > >> 'old-thumb' could be different file names. Update the thumbnail then." > > > > Much better, thanks. > > Ok, so here is a new patch. Thanks, installed. Should this bug now be closed, or is there something else to do here? From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 04 09:37:35 2023 Received: (at 61394) by debbugs.gnu.org; 4 Aug 2023 13:37:35 +0000 Received: from localhost ([127.0.0.1]:53597 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qRuzn-0007RH-Cu for submit@debbugs.gnu.org; Fri, 04 Aug 2023 09:37:35 -0400 Received: from ledu-giraud.fr ([51.159.28.247]:36865) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qRuzl-0007Qw-5f for 61394@debbugs.gnu.org; Fri, 04 Aug 2023 09:37:34 -0400 DKIM-Signature: v=1; a=ed25519-sha256; c=simple/simple; s=ed25519; bh=qg1bysd2 FeH3CjPpSlsdlO11qNy3DqkI3Ao5LJAsJ/k=; h=date:references:in-reply-to: subject:cc:to:from; d=ledu-giraud.fr; b=LmX5cS7xKEKQ8fh1DIGq9J94O6+L6i rYkf+NVRnpP2gSj181SlsdP9wTQ72rfJL8mYmii4wtIyY3AHr5O6NEAQ== DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=qg1bysd2FeH3CjPp SlsdlO11qNy3DqkI3Ao5LJAsJ/k=; h=date:references:in-reply-to:subject: cc:to:from; d=ledu-giraud.fr; b=uNVYRcsipE8NpIwl9/yS5bIjZLt8jvOVnqly5T 8qD/Jd4FPH4oZMlEeJICgTcoRBrArnwPTgyuXGHCwlNnv8ux2L0/wx8D/eqT5Z0dooC5pC yDsspPiUWNTn8TUgBzVKFY8H4iELp8Srx11AtIVzIpcHtnedqwIC4nYw3nlrrDyim2AAbm 8Nq3flOzsiGKHPZ7l4RC/J6pQq1sN7x8KjJZbBj8nsZ5NPA/MWhuxFbT4Sjm9rEZd+rznr AUqaGJEmLjtUpckCmzZ5C/L4J1tKj/CW3bcm6QVdT4jdhBLR2wk+VCdRan05NAMq6QRz8l mkec0qm3E+0W36bxVjjCeOJg== Received: from computer ( [10.1.1.1]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id cb92c82c (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Fri, 4 Aug 2023 15:37:31 +0200 (CEST) From: Manuel Giraud To: Eli Zaretskii Subject: Re: bug#61394: 30.0.50; [PATCH] Image-dired thumb name based on content In-Reply-To: <83zg37ulet.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 04 Aug 2023 13:55:22 +0300") References: <874jruy7xx.fsf@ledu-giraud.fr> <87fs59qx54.fsf@ledu-giraud.fr> <83wmyll9s5.fsf@gnu.org> <87bkfxcaa2.fsf@ledu-giraud.fr> <83wmykjzji.fsf@gnu.org> <877cqkcrds.fsf@ledu-giraud.fr> <83bkfwjkh8.fsf@gnu.org> <871qgsc9fv.fsf@ledu-giraud.fr> <83y1izj2q6.fsf@gnu.org> <87leezhwq0.fsf@ledu-giraud.fr> <87edko9ixu.fsf@ledu-giraud.fr> <87h6piu1zj.fsf@ledu-giraud.fr> <83wmydzn4z.fsf@gnu.org> <87sf91jpe4.fsf@ledu-giraud.fr> <83a5v9z4ve.fsf@gnu.org> <87o7jojs98.fsf@ledu-giraud.fr> <833510xsnt.fsf@gnu.org> <87jzucjchb.fsf@ledu-giraud.fr> <83sf90vv06.fsf@gnu.org> <87bkfnjlp2.fsf@ledu-giraud.fr> <83zg37ulet.fsf@gnu.org> Date: Fri, 04 Aug 2023 15:37:29 +0200 Message-ID: <87fs4zkjxi.fsf@ledu-giraud.fr> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 61394 Cc: contovob@tcd.ie, stefankangas@gmail.com, 61394@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: [...] > Thanks, installed. > > Should this bug now be closed, or is there something else to do here? Thanks. I think it can be closed this feature is complete AFAICT. -- Manuel Giraud From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 04 10:05:52 2023 Received: (at 61394-done) by debbugs.gnu.org; 4 Aug 2023 14:05:52 +0000 Received: from localhost ([127.0.0.1]:54467 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qRvRA-00008P-Ac for submit@debbugs.gnu.org; Fri, 04 Aug 2023 10:05:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50590) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qRvR7-00008B-QW for 61394-done@debbugs.gnu.org; Fri, 04 Aug 2023 10:05:50 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRvR1-0002nW-Qi; Fri, 04 Aug 2023 10:05:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=6opCmwjzt9vWHGwqJ17GmzE0V4V4deEhU/y3M+1M9mQ=; b=sF3msUk76b00 h1wPYqnhbtBymNmSw/uJqffEHBLGtQL5WV5JfUB99oHm47OmPmzgrEfLRUjeNr+jfcz10ASJIuBJv Y+H4pS4lrjG2Y2OIvMjfG6jR8GiKhP3JsTyYxCIxCx/bTvY0QkMK2XcFMpTXKLxXPc68TgwNUC7yS v3V0KsGSWm6pxK2n8UFZxp7MkLCC+XuzVcoMNNQqikA4MO+YE6dzaGmc80Vt4zz1UMDdhf7C553H9 bcBxDx4+es9dqymoD1VkBoYWvIU4vLveFck6a1UxfdmA+GzYeYRtu4/8u7CnzIdzSol2B7eBceRch HOtzliIXBUP9YEpooxNZ5Q==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRvR1-00085H-9t; Fri, 04 Aug 2023 10:05:43 -0400 Date: Fri, 04 Aug 2023 17:05:56 +0300 Message-Id: <83o7jmvr5n.fsf@gnu.org> From: Eli Zaretskii To: Manuel Giraud In-Reply-To: <87fs4zkjxi.fsf@ledu-giraud.fr> (message from Manuel Giraud on Fri, 04 Aug 2023 15:37:29 +0200) Subject: Re: bug#61394: 30.0.50; [PATCH] Image-dired thumb name based on content References: <874jruy7xx.fsf@ledu-giraud.fr> <87fs59qx54.fsf@ledu-giraud.fr> <83wmyll9s5.fsf@gnu.org> <87bkfxcaa2.fsf@ledu-giraud.fr> <83wmykjzji.fsf@gnu.org> <877cqkcrds.fsf@ledu-giraud.fr> <83bkfwjkh8.fsf@gnu.org> <871qgsc9fv.fsf@ledu-giraud.fr> <83y1izj2q6.fsf@gnu.org> <87leezhwq0.fsf@ledu-giraud.fr> <87edko9ixu.fsf@ledu-giraud.fr> <87h6piu1zj.fsf@ledu-giraud.fr> <83wmydzn4z.fsf@gnu.org> <87sf91jpe4.fsf@ledu-giraud.fr> <83a5v9z4ve.fsf@gnu.org> <87o7jojs98.fsf@ledu-giraud.fr> <833510xsnt.fsf@gnu.org> <87jzucjchb.fsf@ledu-giraud.fr> <83sf90vv06.fsf@gnu.org> <87bkfnjlp2.fsf@ledu-giraud.fr> <83zg37ulet.fsf@gnu.org> <87fs4zkjxi.fsf@ledu-giraud.fr> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 61394-done Cc: contovob@tcd.ie, stefankangas@gmail.com, 61394-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Manuel Giraud > Cc: stefankangas@gmail.com, contovob@tcd.ie, 61394@debbugs.gnu.org > Date: Fri, 04 Aug 2023 15:37:29 +0200 > > Eli Zaretskii writes: > > [...] > > > Should this bug now be closed, or is there something else to do here? > > Thanks. I think it can be closed this feature is complete AFAICT. Thanks, done. From unknown Sat Jun 21 05:18:34 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 02 Sep 2023 11:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator