From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#18632: 24.3.94; image-dired fail when `image-dired-dir' doesn't exist Date: Fri, 30 Aug 2019 00:32:52 +0200 Message-ID: References: <871tqmskw1.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="256932"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 18632@debbugs.gnu.org To: Thierry Volpiatto Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Aug 30 00:34:16 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1i3Szf-0014im-VZ for geb-bug-gnu-emacs@m.gmane.org; Fri, 30 Aug 2019 00:34:16 +0200 Original-Received: from localhost ([::1]:55162 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i3Sze-00071F-Qb for geb-bug-gnu-emacs@m.gmane.org; Thu, 29 Aug 2019 18:34:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49095) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i3SzU-0006wn-AC for bug-gnu-emacs@gnu.org; Thu, 29 Aug 2019 18:34:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i3SzS-0003pu-9l for bug-gnu-emacs@gnu.org; Thu, 29 Aug 2019 18:34:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44183) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i3SzS-0003pY-5H for bug-gnu-emacs@gnu.org; Thu, 29 Aug 2019 18:34:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1i3SzS-0002zN-0B for bug-gnu-emacs@gnu.org; Thu, 29 Aug 2019 18:34:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <871tqmskw1.fsf@gmail.com> Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 29 Aug 2019 22:34:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18632 X-GNU-PR-Package: emacs Original-Received: via spool by 18632-submit@debbugs.gnu.org id=B18632.156711799111397 (code B ref 18632); Thu, 29 Aug 2019 22:34:01 +0000 Original-Received: (at 18632) by debbugs.gnu.org; 29 Aug 2019 22:33:11 +0000 Original-Received: from localhost ([127.0.0.1]:53001 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i3Syc-0002xl-Sg for submit@debbugs.gnu.org; Thu, 29 Aug 2019 18:33:11 -0400 Original-Received: from mail-pl1-f170.google.com ([209.85.214.170]:35292) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i3Syb-0002xU-Bl for 18632@debbugs.gnu.org; Thu, 29 Aug 2019 18:33:09 -0400 Original-Received: by mail-pl1-f170.google.com with SMTP id gn20so2287961plb.2 for <18632@debbugs.gnu.org>; Thu, 29 Aug 2019 15:33:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=VZ700wD6L0NKd7tCLrJnTjf7E78th/zikIm2zp1K+xE=; b=MnGkx8X1j5SdgpX6rOa1Hx0MJdoBz9RUyYQZBfVr3Lv6xSpy1TSKUHAGfAaH5K0/3u SKzVbIM9xLOdUBwVx34M85hIP/ErYMCayQy9PHbpOyafWkKD9NypPb5DKGo6+Ox/bBCG 5dWpbTCA7Dq0jgNN46ixT9Teslh4AScZT17LDXolaiVuaazxdYGj6LOurgZsUt7BCKjA 9nJaHQ/QdthAQ4xS9rdpFqQ6EnyXtRAcjSFDC6/R7WaRi/oNOVAEQ5QUwpThnaehGDxi 4Nc/zbzRp19Z9KSIjzLwZ2+ccu5sdlUQ0ucBpFTNjdlwEsyDgm68tmXGL1jtCuo0NDpV mOKw== X-Gm-Message-State: APjAAAW463y43c5PD4Ee+jayzQYf3WEUb1+QiYAsCaszeOqurqYsSLnR SdeVz7ypUiY9zJtCG8hZF+NJlvBe6a/tvgAx3ns= X-Google-Smtp-Source: APXvYqzm3d62Au3BwlRpur6NZaYZWAEL5stqduSMZZWX0hp01QkG5QoVRQsS/NB6CIfGtLm8MtdvdNA6L3iI6Agpluk= X-Received: by 2002:a17:902:8b8c:: with SMTP id ay12mr11765746plb.251.1567117983189; Thu, 29 Aug 2019 15:33:03 -0700 (PDT) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:166061 Archived-At: Thierry Volpiatto writes: >> If `image-dired-dir' doesn't exists, image-dired fail with >> something like "could not resize image" with no indications on what is happening. >> IOW image-dired should create its directory when this one doesn't >> exists, or at least send a helpful message to notify user he have first >> to create manually this directory. > > diff --git a/lisp/image-dired.el b/lisp/image-dired.el > index 114deab..01f88c2 100644 > --- a/lisp/image-dired.el > +++ b/lisp/image-dired.el > @@ -1800,7 +1800,8 @@ should feel snappy enough. > > If optional argument ORIGINAL-SIZE is non-nil, display image in its > original size." > - (let ((new-file (expand-file-name image-dired-temp-image-file)) > + (let ((new-file (expand-file-name image-dired-temp-image-file > + (image-dired-dir))) > width height command ret > (image-type 'jpeg)) > (setq file (expand-file-name file)) I can reproduce this on current master. The problem happens when the user removes the image-dired-dir directory (normally ~/.emacs.d/image-dired). Steps to reproduce: 0. emacs -Q 1. C-x C-f ~/my-image-dir 2. (in shell) rm -rf ~/.emacs.d/image-dired/ # value of (image-dired-dir) 3. (in emacs): RET Now I see the error message "Unable to resize". However, I think the above patch is only part of the solution. After applying it, I can indeed open an image successfully. But I'm now seeing a different problem: After opening an image (step 3 above), all the thumbnails are suddenly missing from the *image-dired* buffer. I subjectively think that the original error is less severe than the new one. Without the fix, at least the images stay as they are in the *image-dired* buffer. If anyone disagrees, they could easily install the above patch on master and we would arguably be no worse off than we are now. But we would still need to fix the second problem. Thanks, Stefan Kangas