[shotwell] picasa: Use proper mime type for video
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [shotwell] picasa: Use proper mime type for video
- Date: Tue, 21 Feb 2017 22:03:37 +0000 (UTC)
commit ddcc9c9b4eb4e3c2582f939235282791465157ba
Author: Jens Georg <mail jensge org>
Date: Tue Feb 21 22:57:47 2017 +0100
picasa: Use proper mime type for video
Signed-off-by: Jens Georg <mail jensge org>
plugins/shotwell-publishing/PicasaPublishing.vala | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/plugins/shotwell-publishing/PicasaPublishing.vala
b/plugins/shotwell-publishing/PicasaPublishing.vala
index ba4018a..8f8f647 100644
--- a/plugins/shotwell-publishing/PicasaPublishing.vala
+++ b/plugins/shotwell-publishing/PicasaPublishing.vala
@@ -414,8 +414,16 @@ internal class UploadTransaction :
this.session = session;
this.parameters = parameters;
this.publishable = publishable;
- this.mime_type = (publishable.get_media_type() == Spit.Publishing.Publisher.MediaType.VIDEO) ?
- "video/mpeg" : "image/jpeg";
+ if (publishable.get_media_type() == Spit.Publishing.Publisher.MediaType.VIDEO) {
+ try {
+ var info =
this.publishable.get_serialized_file().query_info(FileAttribute.STANDARD_CONTENT_TYPE,
FileQueryInfoFlags.NONE);
+ this.mime_type = ContentType.get_mime_type(info.get_content_type());
+ } catch (Error err) {
+ this.mime_type = "video/mpeg";
+ }
+ } else {
+ this.mime_type = "image/jpeg";
+ }
}
public override void execute() throws Spit.Publishing.PublishingError {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]