gpg "showphoto" not creating temp file on Windows 10
Closed, ResolvedPublic

Description

Windows 10 PRO / 64 bit -- version 1809
32.0 GB RAM

gpg (GnuPG) 2.2.11
libgcrypt 1.8.4

On the command line, I use gpg --edit-key KEY_ID to open a key. I then use UID # to highlight the photo and then enter "showphoto". This brings up a Windows 10 dialog box asking me to choose the program I want to use to view the image. It makes no difference which program I choose, the result is always the same. I receive an error message the shows that "C:\Users\Gerard\AppData\Local\Temp\gpg-62cno9\87DEC564.jpg" does not exist. I have double checked that directory, and the file does not exist. GPG is most likely not creating the temporary file or is placing it in the wrong location. I have tried this with different keys and the results remain the same.

Gerard created this task.Jan 23 2019, 11:24 AM
werner triaged this task as Normal priority.
werner claimed this task.May 16 2019, 12:44 PM

Actually the temp file is created but because the photo viewer is run as a detached process and gpg keeps on running, the temp file has been removed by gpg at the time the photo viewer tries to open it. Ooops. The correct behaviour would be to wait for the photo viewer to be finished. We use

cmd /c start /w TEMPFILE.jpg

so that start looks up the program to display the photo. This used to work on older Windows versions . The new photo viewer on Windows (I tested with 8.1 and current 10) seems to return immediately and thus start can't wait for it. We need to find a way to find a photo viewer which will actually wait.

Workaround is

--photo-viewer "cmd /c start /w %I"

(uppercase %i ) but that does not remove the jpeg file.

werner closed this task as Resolved.May 17 2019, 12:52 PM

There will be no full solution for this. However, the next release should in general work due to a 400ms delay we use after spawning the viewer. This is configurable; see rG7e5847da0f3d715cb59d05adcd9107b460b6411b.