[fractal] message: Add size field to thumbnail_info



commit 260ef54be8ddc271c8422e38f999d639dd6ed414
Author: yatinmaan <yatinmaan1 gmail com>
Date:   Sat Jan 25 23:22:05 2020 +0530

    message: Add size field to thumbnail_info

 fractal-gtk/src/appop/message.rs | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/fractal-gtk/src/appop/message.rs b/fractal-gtk/src/appop/message.rs
index ed8fb5c1..e15cdcf9 100644
--- a/fractal-gtk/src/appop/message.rs
+++ b/fractal-gtk/src/appop/message.rs
@@ -562,6 +562,7 @@ fn get_image_media_info(file: &str, mimetype: &str) -> Option<JsonValue> {
         x.to_string()
     );
     thumb.savev(&thumb_path, "png", &[]).ok()?;
+    let thumb_size = fs::metadata(&thumb_path).ok()?.len();
 
     let info = json!({
         "info": {
@@ -569,6 +570,7 @@ fn get_image_media_info(file: &str, mimetype: &str) -> Option<JsonValue> {
             "thumbnail_info": {
                 "w": thumb.get_width(),
                 "h": thumb.get_height(),
+                "size": thumb_size,
                 "mimetype": "image/png"
             },
             "w": w,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]