GNOME Bugzilla – Bug 302986
View Image should use content-disposition for image filename
Last modified: 2010-10-25 06:49:59 UTC
instead of a random filename (it's okay since we save in a secure temp directory).
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"?
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
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
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.
Fix proposed in the blocker bug.
Comment on attachment 161154 [details] [review] ephy-file-helpers: use g_mkstemp instead of mkstemp OK.
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 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.
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
Any comment?
Review of attachment 162716 [details] [review]: Makes sense to me.
Attachment 162716 [details] pushed as 0bc6455 - popup-commands: use the image name on Open image