After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 302986 - View Image should use content-disposition for image filename
View Image should use content-disposition for image filename
Status: RESOLVED FIXED
Product: epiphany
Classification: Core
Component: Downloads
git master
Other Linux
: Normal enhancement
: Ephy/XR
Assigned To: Epiphany Maintainers
Marco Pesenti Gritti
Depends on: 618757
Blocks:
 
 
Reported: 2005-05-04 12:43 UTC by Christian Persch
Modified: 2010-10-25 06:49 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
ephy-file-helpers: use g_mkstemp instead of mkstemp (739 bytes, patch)
2010-05-16 01:47 UTC, Diego Escalante Urrelo (not reading bugmail)
committed Details | Review
popup-commands: use the image name on Open image (2.04 KB, patch)
2010-05-16 01:47 UTC, Diego Escalante Urrelo (not reading bugmail)
none Details | Review
popup-commands: use the image name on Open image (2.04 KB, patch)
2010-06-04 00:34 UTC, Diego Escalante Urrelo (not reading bugmail)
committed Details | Review

Description Christian Persch 2005-05-04 12:43:04 UTC
instead of a random filename (it's okay since we save in a secure temp directory).
Comment 1 Josh Lee 2005-07-15 19:50:28 UTC
It's also a good idea to use the real filename, because EOG provides the
capability to save an image, and what are you going to do with "viewimageL6Bwa.tmp"?
Comment 2 Diego Escalante Urrelo (not reading bugmail) 2010-05-16 01:47:14 UTC
Created attachment 161154 [details] [review]
ephy-file-helpers: use g_mkstemp instead of mkstemp

This allows the "XXXXXX" token to be anywhere in the tmpl string.

Bug #302986
Comment 3 Diego Escalante Urrelo (not reading bugmail) 2010-05-16 01:47:18 UTC
Created attachment 161155 [details] [review]
popup-commands: use the image name on Open image

Name the temp file "XXXXXX_<original_name>" instead of "viewimageXXXXXX.tmp".

Bug #302986
Comment 4 Diego Escalante Urrelo (not reading bugmail) 2010-05-16 01:59:57 UTC
With this patch EOG refuses to load images when the extension does not match the image type.

Right now, thanks to the .tmp extension we use, EOG allows anything we give it to be shown. But with this patch if the website has wrong extensions then EOG will fail to show the image.

Not our fault or EOG's at all, but still a regression. I filled bug 618757 asking EOG people to insist on opening when the extension is bogus, given that unknown extensions are happily loaded anyway.
Comment 5 Diego Escalante Urrelo (not reading bugmail) 2010-05-16 03:28:32 UTC
Fix proposed in the blocker bug.
Comment 6 Xan Lopez 2010-05-16 10:54:23 UTC
Comment on attachment 161154 [details] [review]
ephy-file-helpers: use g_mkstemp instead of mkstemp

OK.
Comment 7 Diego Escalante Urrelo (not reading bugmail) 2010-06-04 00:20:20 UTC
Xan, what if we name the file like this instead: "profilepicture.jpg.XXXXXX"

This would avoid the EOG problem (the unknown extension would work as .tmp works now) and you could still reuse the original name of your image.

Agree?
Comment 8 Diego Escalante Urrelo (not reading bugmail) 2010-06-04 00:34:38 UTC
Comment on attachment 161154 [details] [review]
ephy-file-helpers: use g_mkstemp instead of mkstemp

Attachment 161154 [details] pushed as 137389a - ephy-file-helpers: use g_mkstemp instead of mkstemp

Pushed this patch. Attaching an updated version of the name one.
Comment 9 Diego Escalante Urrelo (not reading bugmail) 2010-06-04 00:34:57 UTC
Created attachment 162716 [details] [review]
popup-commands: use the image name on Open image

Name the temp file "<original_name>.XXXXXX" instead of "viewimageXXXXXX.tmp".

Bug #302986
Comment 10 Diego Escalante Urrelo (not reading bugmail) 2010-10-12 03:28:33 UTC
Any comment?
Comment 11 Xan Lopez 2010-10-24 14:03:32 UTC
Review of attachment 162716 [details] [review]:

Makes sense to me.
Comment 12 Diego Escalante Urrelo (not reading bugmail) 2010-10-25 06:49:53 UTC
Attachment 162716 [details] pushed as 0bc6455 - popup-commands: use the image name on Open image