On Mon, 2020-01-13 at 22:08 +0100, [email protected] wrote:
> Good job! This does indeed fix the missing thumbnailer timeout
> enforcement on Windows. I integrated your changes manually:
> 
> https://github.com/cwrsimon/shotwell/blob/b11503d8e3052374a3831c14dda551ca2ac553e6/src/VideoSupport.vala
> 
> Unfortunately, it is still necessary to Base64-encode/decode the
> pixbuf data on Windows. Also, I took the liberty of using
> GLib.SubprocessLauncher first. That makes it possible to set the
> working directory. If we are lucky, this won't be necessary anymore,
> once your changes to the thumbnailer have made it into the stable
> development line.

Does the attached patch help with that?


From 82a15be00ea1027b4f62bed463afab844d47c2b9 Mon Sep 17 00:00:00 2001
From: Jens Georg <[email protected]>
Date: Tue, 14 Jan 2020 19:40:33 +0100
Subject: [PATCH] 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);
-- 
2.20.1

_______________________________________________
shotwell-list mailing list
[email protected]
https://mail.gnome.org/mailman/listinfo/shotwell-list

Reply via email to