[shotwell] thumbnailer: Explicitly set stdout to binary



commit 952d94ad95bcd293deb5c979c9fc6a53bc409e63
Author: Jens Georg <mail jensge org>
Date:   Tue Jan 14 19:40:33 2020 +0100

    thumbnailer: Explicitly set stdout to binary

 thumbnailer/shotwell-video-thumbnailer.vala | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/thumbnailer/shotwell-video-thumbnailer.vala b/thumbnailer/shotwell-video-thumbnailer.vala
index 5da4deaf..e31e00ee 100644
--- a/thumbnailer/shotwell-video-thumbnailer.vala
+++ b/thumbnailer/shotwell-video-thumbnailer.vala
@@ -19,6 +19,7 @@ class ShotwellThumbnailer {
         uint8[]? pngdata;
         int64 duration, position;
         Gst.StateChangeReturn ret;
+        var out = FileStream.fdopen(Posix.dup(stdout.fileno()), "wb");
 
         if (Posix.nice (19) < 0) {
             debug ("Failed to reduce thumbnailer nice level. Continuing anyway");
@@ -115,14 +116,12 @@ class ShotwellThumbnailer {
                 }
             }
 
-            stderr.printf("Oritentation: %s\n", direction.to_string());
-
             // Save the pixbuf.
             if (direction != Gdk.PixbufRotation.NONE) {
                 pixbuf = pixbuf.rotate_simple(direction);
             }
             pixbuf.save_to_buffer(out pngdata, "png");
-            stdout.write(pngdata);
+            out.write(pngdata);
 
             // cleanup and exit.
             pipeline.set_state(Gst.State.NULL);


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