GNU bug report logs - #61394
30.0.50; [PATCH] Image-dired thumb name based on content

Previous Next

Package: emacs;

Reported by: Manuel Giraud <manuel <at> ledu-giraud.fr>

Date: Thu, 9 Feb 2023 19:08:02 UTC

Severity: normal

Tags: patch

Found in version 30.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Basil Contovounesios <contovob <at> tcd.ie>
To: 61394 <at> debbugs.gnu.org
Cc: Manuel Giraud <manuel <at> ledu-giraud.fr>
Subject: bug#61394: 30.0.50; [PATCH] Image-dired thumb name based on content
Date: Fri, 10 Feb 2023 15:13:27 +0000
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




This bug report was last modified 1 year and 290 days ago.

Previous Next


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