When I try to display a pil image using the XDGViewer viewer, okular (I am on kde, and okular is my default image viewer) displays a message it can't open the file. Indeed, it is not present in the /tmp when I look for it.
Since it works as expected with DisplayViewer (and the file is present until I close the window), I suspect xdg-open to launch okular and quit immediately, and then, since xdg closed, the file is removed immediately before okular can access it.
Is there a way to prevent deleting the temporary file (my /tmp is mounted on tmpfs, thus it's not really a problem...) ? for example, deleting the temporary file eigher when the image gets garbage-collected or when the interpreter closes ?