[shotwell] piwigo: Add .jpg extension to file name
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [shotwell] piwigo: Add .jpg extension to file name
- Date: Tue, 7 Mar 2017 23:05:40 +0000 (UTC)
commit f24bd7af01eff3e3085134ba7de5a5e898e3fbbf
Author: Jens Georg <mail jensge org>
Date: Tue Mar 7 23:53:25 2017 +0100
piwigo: Add .jpg extension to file name
Otherwise downloading files would cause the original RAW file name
created with JPEG contents
Signed-off-by: Jens Georg <mail jensge org>
https://bugzilla.gnome.org/show_bug.cgi?id=729091
plugins/shotwell-publishing/PiwigoPublishing.vala | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/plugins/shotwell-publishing/PiwigoPublishing.vala
b/plugins/shotwell-publishing/PiwigoPublishing.vala
index 60219a6..15d118b 100644
--- a/plugins/shotwell-publishing/PiwigoPublishing.vala
+++ b/plugins/shotwell-publishing/PiwigoPublishing.vala
@@ -1773,9 +1773,12 @@ private class ImagesAddTransaction : Publishing.RESTSupport.UploadTransaction {
GLib.HashTable<string, string> disposition_table =
new GLib.HashTable<string, string>(GLib.str_hash, GLib.str_equal);
- disposition_table.insert("filename", Soup.URI.encode(
- publishable.get_param_string(
- Spit.Publishing.Publishable.PARAM_STRING_BASENAME), null));
+ var basename = publishable.get_param_string(Spit.Publishing.Publishable.PARAM_STRING_BASENAME);
+ if (!basename.down().has_suffix(".jpeg") &&
+ !basename.down().has_suffix(".jpg")) {
+ basename += ".jpg";
+ }
+ disposition_table.insert("filename", Soup.URI.encode(basename, null));
disposition_table.insert("name", "image");
set_binary_disposition_table(disposition_table);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]