unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#21870: 25.0.50; image now shown after decrypting image file
@ 2015-11-10  8:30 Dirk-Jan C. Binnema
  2015-11-10 16:22 ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Dirk-Jan C. Binnema @ 2015-11-10  8:30 UTC (permalink / raw)
  To: 21870

It seems the auto-decryption functionality does not work correctly for
encrypted images - that is, decryption works, but then the image is not
shown.

Steps to reproduce:
1) Open an encrypted image file (say, test.jpeg.gpg)
2) Enter the passphrase, when asked (by easypg I assume)
3) Now, see a small rectangle in the upper left of the current window;
   instead of the expected image

Expected behavior would be to see the image, just as if opening
test.jpeg directly.

The mentioned rectangle does seem to point the correct data (when
looking at it with image-toggle-display. 

In GNU Emacs 25.0.50.129 (x86_64-unknown-linux-gnu, GTK+ Version 3.18.2)
 of 2015-11-02
Repository revision: d4352f813a0703cc7f7a873525131b272ef0c105
Windowing system distributor 'Fedora Project', version 11.0.11799902
System Description:	Fedora release 23 (Twenty Three)

Configured using:
 'configure
 PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/pkgconfig::/usr/local/Cellar/sqlite/3.7.15.1/lib/pkgconfig/'

Configured features:
XPM JPEG TIFF GIF PNG IMAGEMAGICK SOUND DBUS GSETTINGS NOTIFY ACL
LIBSELINUX GNUTLS LIBXML2 FREETYPE XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11






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

* bug#21870: 25.0.50; image now shown after decrypting image file
  2015-11-10  8:30 bug#21870: 25.0.50; image now shown after decrypting image file Dirk-Jan C. Binnema
@ 2015-11-10 16:22 ` Eli Zaretskii
  2015-11-10 17:12   ` Dirk-Jan C. Binnema
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2015-11-10 16:22 UTC (permalink / raw)
  To: Dirk-Jan C. Binnema; +Cc: 21870

> From: Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
> Date: Tue, 10 Nov 2015 10:30:44 +0200
> 
> It seems the auto-decryption functionality does not work correctly for
> encrypted images - that is, decryption works, but then the image is not
> shown.
> 
> Steps to reproduce:
> 1) Open an encrypted image file (say, test.jpeg.gpg)
> 2) Enter the passphrase, when asked (by easypg I assume)
> 3) Now, see a small rectangle in the upper left of the current window;
>    instead of the expected image
> 
> Expected behavior would be to see the image, just as if opening
> test.jpeg directly.

If you do the same with a different kind of file, does Emacs activate
the correct major mode after decrypting the file?





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

* bug#21870: 25.0.50; image now shown after decrypting image file
  2015-11-10 16:22 ` Eli Zaretskii
@ 2015-11-10 17:12   ` Dirk-Jan C. Binnema
  2015-11-14 14:34     ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Dirk-Jan C. Binnema @ 2015-11-10 17:12 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 21870


On Tuesday Nov 10 2015, Eli Zaretskii wrote:

>> From: Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
>> Date: Tue, 10 Nov 2015 10:30:44 +0200
>> 
>> It seems the auto-decryption functionality does not work correctly for
>> encrypted images - that is, decryption works, but then the image is not
>> shown.
>> 
>> Steps to reproduce:
>> 1) Open an encrypted image file (say, test.jpeg.gpg)
>> 2) Enter the passphrase, when asked (by easypg I assume)
>> 3) Now, see a small rectangle in the upper left of the current window;
>>    instead of the expected image
>> 
>> Expected behavior would be to see the image, just as if opening
>> test.jpeg directly.
>
> If you do the same with a different kind of file, does Emacs activate
> the correct major mode after decrypting the file?

Yes - e.g. opening test.org.gpg will decrypt, then activate org-mode.

(and note that this is reproducible with emacs -Q)

Kind regards,
Dirk.

-- 
Dirk-Jan C. Binnema                  Helsinki, Finland
e:djcb@djcbsoftware.nl           w:www.djcbsoftware.nl
pgp: D09C E664 897D 7D39 5047 A178 E96A C7A1 017D DA3C





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

* bug#21870: 25.0.50; image now shown after decrypting image file
  2015-11-10 17:12   ` Dirk-Jan C. Binnema
@ 2015-11-14 14:34     ` Eli Zaretskii
  2015-11-16  6:10       ` Daiki Ueno
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2015-11-14 14:34 UTC (permalink / raw)
  To: Dirk-Jan C. Binnema, Daiki Ueno; +Cc: 21870

> From: Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
> Cc: 21870@debbugs.gnu.org
> Date: Tue, 10 Nov 2015 19:12:51 +0200
> 
> On Tuesday Nov 10 2015, Eli Zaretskii wrote:
> 
> >> From: Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
> >> Date: Tue, 10 Nov 2015 10:30:44 +0200
> >> 
> >> It seems the auto-decryption functionality does not work correctly for
> >> encrypted images - that is, decryption works, but then the image is not
> >> shown.
> >> 
> >> Steps to reproduce:
> >> 1) Open an encrypted image file (say, test.jpeg.gpg)
> >> 2) Enter the passphrase, when asked (by easypg I assume)
> >> 3) Now, see a small rectangle in the upper left of the current window;
> >>    instead of the expected image
> >> 
> >> Expected behavior would be to see the image, just as if opening
> >> test.jpeg directly.
> >
> > If you do the same with a different kind of file, does Emacs activate
> > the correct major mode after decrypting the file?
> 
> Yes - e.g. opening test.org.gpg will decrypt, then activate org-mode.
> 
> (and note that this is reproducible with emacs -Q)

Looks like epa-file.el doesn't run normal-mode after decrypting the
file?

Daiki, would you please look into this?  If you want to install a fix,
please do that on the emacs-25 branch.

Thanks.





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

* bug#21870: 25.0.50; image now shown after decrypting image file
  2015-11-14 14:34     ` Eli Zaretskii
@ 2015-11-16  6:10       ` Daiki Ueno
  2015-11-16  7:50         ` Dirk-Jan C. Binnema
  0 siblings, 1 reply; 7+ messages in thread
From: Daiki Ueno @ 2015-11-16  6:10 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Dirk-Jan C. Binnema, 21870

[-- Attachment #1: Type: text/plain, Size: 1234 bytes --]

Eli Zaretskii <eliz@gnu.org> writes:

>> >> It seems the auto-decryption functionality does not work correctly for
>> >> encrypted images - that is, decryption works, but then the image is not
>> >> shown.
>> >> 
>> >> Steps to reproduce:
>> >> 1) Open an encrypted image file (say, test.jpeg.gpg)
>> >> 2) Enter the passphrase, when asked (by easypg I assume)
>> >> 3) Now, see a small rectangle in the upper left of the current window;
>> >>    instead of the expected image
>> >> 
>> >> Expected behavior would be to see the image, just as if opening
>> >> test.jpeg directly.
>> >
>> > If you do the same with a different kind of file, does Emacs activate
>> > the correct major mode after decrypting the file?
>> 
>> Yes - e.g. opening test.org.gpg will decrypt, then activate org-mode.
>> 
>> (and note that this is reproducible with emacs -Q)
>
> Looks like epa-file.el doesn't run normal-mode after decrypting the
> file?

Thanks for forwarding.  Hmm, it seems that normal-mode is actually
called, but image-mode tries to load the contents from the file, not
from the buffer.  Does the following hack look correct?

(It seems reading test.jpeg.gz works because ImageMagick supports
compressed files.)

Regards,
-- 
Daiki Ueno

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: image-mode.el.diff --]
[-- Type: text/x-patch, Size: 733 bytes --]

diff --git a/lisp/image-mode.el b/lisp/image-mode.el
index e6d6a3e..12c8b95 100644
--- a/lisp/image-mode.el
+++ b/lisp/image-mode.el
@@ -658,7 +658,11 @@ image-toggle-display-image
 			   (not (and (boundp 'archive-superior-buffer)
 				     archive-superior-buffer))
 			   (not (and (boundp 'tar-superior-buffer)
-				     tar-superior-buffer)))))
+				     tar-superior-buffer))
+                           (not (eq (find-file-name-handler
+                                     filename
+                                     'insert-file-contents)
+                                    'epa-file-handler)))))
 	 (file-or-data (if data-p
 			   (string-make-unibyte
 			    (buffer-substring-no-properties (point-min) (point-max)))

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

* bug#21870: 25.0.50; image now shown after decrypting image file
  2015-11-16  6:10       ` Daiki Ueno
@ 2015-11-16  7:50         ` Dirk-Jan C. Binnema
  2015-11-17  2:52           ` Daiki Ueno
  0 siblings, 1 reply; 7+ messages in thread
From: Dirk-Jan C. Binnema @ 2015-11-16  7:50 UTC (permalink / raw)
  To: Daiki Ueno; +Cc: 21870


On Monday Nov 16 2015, Daiki Ueno wrote:

> Eli Zaretskii <eliz@gnu.org> writes:
>
>>> >> It seems the auto-decryption functionality does not work correctly for
>>> >> encrypted images - that is, decryption works, but then the image is not
>>> >> shown.

[...]

>> Looks like epa-file.el doesn't run normal-mode after decrypting the
>> file?
>
> Thanks for forwarding.  Hmm, it seems that normal-mode is actually
> called, but image-mode tries to load the contents from the file, not
> from the buffer.  Does the following hack look correct?
>
> (It seems reading test.jpeg.gz works because ImageMagick supports
> compressed files.)

Yes -- seems that did the trick. Just tried it with the patch and the
image is now shown as expected.

Thanks!
Dirk.


-- 
Dirk-Jan C. Binnema                  Helsinki, Finland
e:djcb@djcbsoftware.nl           w:www.djcbsoftware.nl
pgp: D09C E664 897D 7D39 5047 A178 E96A C7A1 017D DA3C





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

* bug#21870: 25.0.50; image now shown after decrypting image file
  2015-11-16  7:50         ` Dirk-Jan C. Binnema
@ 2015-11-17  2:52           ` Daiki Ueno
  0 siblings, 0 replies; 7+ messages in thread
From: Daiki Ueno @ 2015-11-17  2:52 UTC (permalink / raw)
  To: Dirk-Jan C. Binnema; +Cc: 21870-done

Dirk-Jan C. Binnema <djcb@djcbsoftware.nl> writes:

>> Thanks for forwarding.  Hmm, it seems that normal-mode is actually
>> called, but image-mode tries to load the contents from the file, not
>> from the buffer.  Does the following hack look correct?
>>
>> (It seems reading test.jpeg.gz works because ImageMagick supports
>> compressed files.)
>
> Yes -- seems that did the trick. Just tried it with the patch and the
> image is now shown as expected.

Thanks for testing.  Since the check was brittle, I have installed a
slightly modified version to both master and emacs-25:
http://git.sv.gnu.org/cgit/emacs.git/commit/?id=58e62350

Regards,
-- 
Daiki Ueno





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

end of thread, other threads:[~2015-11-17  2:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-10  8:30 bug#21870: 25.0.50; image now shown after decrypting image file Dirk-Jan C. Binnema
2015-11-10 16:22 ` Eli Zaretskii
2015-11-10 17:12   ` Dirk-Jan C. Binnema
2015-11-14 14:34     ` Eli Zaretskii
2015-11-16  6:10       ` Daiki Ueno
2015-11-16  7:50         ` Dirk-Jan C. Binnema
2015-11-17  2:52           ` Daiki Ueno

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).