unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#56375: 28.1.50; Calling "convert" from thumbs.el is broken
@ 2022-07-03 23:48 Benjamin Riefenstahl
       [not found] ` <handler.56375.B.165689216211384.ack@debbugs.gnu.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Benjamin Riefenstahl @ 2022-07-03 23:48 UTC (permalink / raw)
  To: 56375


* dired to a directory with images that are larger than 100x100 pixels

* M-x thumbs-dired-show

* I get a buffer with the first few images in the directory in their
  original size

* I expect the images to be scaled to thumbs smaller than 100x100,
  see thumbs-geometry

Tracing the code I stumble onto thumbs-call-convert.  Some time in the
past this was converted from using the shell to passing the parameters
directly, but the fallout was not handled correctly.

I will post a patch as a follow-up.

----

In GNU Emacs 28.1.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.24, cairo version 1.16.0)
 of 2022-05-12 built on zenobia
Repository revision: f03c5d81bd4a7af1364558b406e2b87a78b3af73
Repository branch: emacs-28
System Description: Debian GNU/Linux 11 (bullseye)

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

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

Major mode: Group

Minor modes in effect:
  gnus-topic-mode: t
  gnus-undo-mode: t
  desktop-save-mode: t
  display-time-mode: t
  xclip-mode: t
  xterm-mouse-mode: t
  delete-selection-mode: t
  cua-mode: t
  tooltip-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
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
~/Projects/ttf-mode/arc-mode-compat hides ~/emacs/arc-mode-compat
/home/benny/.emacs.d/elpa/transient-20210920.1038/transient hides /usr/local/share/emacs/28.1.50/lisp/transient
/home/benny/site-lisp/dictionary-1.10/dictionary hides /usr/local/share/emacs/28.1.50/lisp/net/dictionary

Features:
(shadow bbdb-message emacsbug dired-aux gnus-html help-fns bookmark
gnus-kill nnselect gnus-search eieio-opt speedbar ezimage dframe
find-func nndoc flow-fill misearch multi-isearch smerge-mode diff
compile descr-text cus-start termshape shr-color color format-spec
benny-nitter eww xdg url-queue thingatpt benny-url sort gnus-cite
mail-extr gnus-bcklg gnus-async gnus-dup gnus-ml pp gnus-topic jka-compr
url-http url-gw mm-archive url-file url-dired url-cache url-auth qp
gnutls nndraft nnmh nnfolder bbdb-gnus bbdb-mua network-stream nsm
gnus-agent gnus-srvr gnus-score score-mode nnvirtual gnus-msg nntp
gnus-cache pop3 nnrss gnus-art mm-uu mml2015 mm-view mml-smime smime dig
gnus-sum shr kinsoku svg dom gnus-group gnus-undo mm-url bbdb-com crm
message-x bbdb bbdb-site timezone gnus-start gnus-dbus dbus xml
gnus-cloud nnimap nnmail mail-source utf7 netrc nnoo parse-time iso8601
gnus-spec gnus-int gnus-range message rmc puny rfc822 mml mml-sec epa
epg rfc6068 epg-config mm-decode mm-bodies mm-encode mailabbrev
gmm-utils mailheader gnus-win gnus nnheader gnus-util rmail
rmail-loaddefs text-property-search wid-edit mule-util imenu time-date
desktop frameset highline benny-calendar-cfg ange-ftp comint ansi-color
ring generic-x autoinsert cc-mode cc-fonts cc-guess cc-menus cc-styles
cc-align cc-cmds cc-engine cc-vars cc-defs ps-print ps-print-loaddefs
ps-def lpr advice cl-extra help-mode dired dired-loaddefs
benny-x-clipboard disp-table time server protbuf xclip term/xterm xterm
xt-mouse cal-china lunar solar cal-dst cal-bahai cal-islam cal-hebrew
holidays hol-loaddefs vc-git diff-mode easy-mmode vc-dispatcher
vc-fossil diary-lib diary-loaddefs cal-menu calendar cal-loaddefs delsel
cua-base cus-load benny-file-cache filecache derived sendmail mail-utils
benny-tools autoload radix-tree lisp-mnt mail-parse rfc2231 rfc2047
rfc2045 mm-util ietf-drums mail-prsvr finder-inf edmacro kmacro info
package browse-url url url-proxy url-privacy url-expand url-methods
url-history url-cookie url-domsuf url-util mailcap url-handlers
url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs
password-cache json subr-x map url-vars seq byte-opt gv bytecomp
byte-compile cconv cl-loaddefs cl-lib iso-transl tooltip eldoc paren
electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel
term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode
prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu
timer select scroll-bar mouse jit-lock font-lock syntax font-core
term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms
cp51932 hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese composite emoji-zwj charscript charprop case-table
epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice
button loaddefs faces cus-face macroexp files window text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote threads dbusbind inotify lcms2
dynamic-setting system-font-setting font-render-setting cairo
move-toolbar gtk x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 361711 129281)
 (symbols 48 39764 19)
 (strings 32 212367 23946)
 (string-bytes 1 6513504)
 (vectors 16 52664)
 (vector-slots 8 1676247 215016)
 (floats 8 1030 1251)
 (intervals 56 1742 1237)
 (buffers 992 29))





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#56375: 28.1.50; Calling "convert" from thumbs.el is broken
       [not found] ` <handler.56375.B.165689216211384.ack@debbugs.gnu.org>
@ 2022-07-04  0:04   ` Benjamin Riefenstahl
  2022-07-04 10:57     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: Benjamin Riefenstahl @ 2022-07-04  0:04 UTC (permalink / raw)
  To: 56375

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: 0001-lisp-thumbs.el-Fix-calling-the-convert-command.patch --]
[-- Type: text/x-diff, Size: 1985 bytes --]

From 7418e68266b9d593219c6a84be5d519844855f3a Mon Sep 17 00:00:00 2001
From: Benjamin Riefenstahl <b.riefenstahl@turtle-trading.net>
Date: Sun, 3 Jul 2022 15:52:13 -0700
Subject: [PATCH] lisp/thumbs.el: Fix calling the "convert" command

* lisp/thumbs.el (thumbs-call-convert): Pass 'action-prefix' and
'action' as a combined parameter.  Do not pass 'arg' if it is nil.
(thumbs-modify-image): Do not pass "" as 'arg' to
'thumbs-call-convert'.

(Bug#56375)
---
 lisp/thumbs.el | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/lisp/thumbs.el b/lisp/thumbs.el
index 3bf08dd6a5..e622bcedc4 100644
--- a/lisp/thumbs.el
+++ b/lisp/thumbs.el
@@ -215,16 +215,17 @@ thumbs-call-convert
 FILEOUT is the output file,
 ACTION is the command to send to convert.
 Optional arguments are:
-ARG any arguments to the ACTION command,
+ARG if non-nil, the argument of the ACTION command,
 OUTPUT-FORMAT is the file format to output (default is jpeg),
 ACTION-PREFIX is the symbol to place before the ACTION command
               (defaults to `-' but can sometimes be `+')."
-  (call-process thumbs-conversion-program nil nil nil
-		(or action-prefix "-")
-		action
-		(or arg "")
-		filein
-		(format "%s:%s"	(or output-format "jpeg") fileout)))
+  (let ((action-param (concat (or action-prefix "-") action))
+	(fileout-param (format "%s:%s" (or output-format "jpeg") fileout)))
+    (if arg
+	(call-process thumbs-conversion-program nil nil nil
+		      action-param arg filein fileout-param)
+      (call-process thumbs-conversion-program nil nil nil
+		    action-param filein fileout-param))))
 
 (defun thumbs-new-image-size (s increment)
   "New image (a cons of width x height)."
@@ -610,7 +611,7 @@ thumbs-modify-image
     (thumbs-call-convert (or old thumbs-current-image-filename)
 			 tmp
 			 action
-			 (or arg ""))
+			 arg)
     (save-excursion
       (thumbs-insert-image tmp 'jpeg 0))
     (setq thumbs-current-tmp-filename tmp)))
-- 
2.30.2






^ permalink raw reply related	[flat|nested] 3+ messages in thread

* bug#56375: 28.1.50; Calling "convert" from thumbs.el is broken
  2022-07-04  0:04   ` Benjamin Riefenstahl
@ 2022-07-04 10:57     ` Lars Ingebrigtsen
  0 siblings, 0 replies; 3+ messages in thread
From: Lars Ingebrigtsen @ 2022-07-04 10:57 UTC (permalink / raw)
  To: Benjamin Riefenstahl; +Cc: 56375

Benjamin Riefenstahl <b.riefenstahl@turtle-trading.net> writes:

> * lisp/thumbs.el (thumbs-call-convert): Pass 'action-prefix' and
> 'action' as a combined parameter.  Do not pass 'arg' if it is nil.
> (thumbs-modify-image): Do not pass "" as 'arg' to
> 'thumbs-call-convert'.

Thanks; pushed to Emacs 29.

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





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-07-04 10:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-03 23:48 bug#56375: 28.1.50; Calling "convert" from thumbs.el is broken Benjamin Riefenstahl
     [not found] ` <handler.56375.B.165689216211384.ack@debbugs.gnu.org>
2022-07-04  0:04   ` Benjamin Riefenstahl
2022-07-04 10:57     ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).