VERSION + fix custom image
authorNiki Roo <niki@nikiroo.be>
Sun, 28 Apr 2019 17:20:08 +0000 (19:20 +0200)
committerNiki Roo <niki@nikiroo.be>
Sun, 28 Apr 2019 17:20:08 +0000 (19:20 +0200)
VERSION
src/be/nikiroo/utils/serial/SerialUtils.java

diff --git a/VERSION b/VERSION
index 8f820dec20539acb9e0e030b9ae3a58efb66ffaf..1a71b82d95067121806d7d8ad5e8418ed88fd4d1 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-4.7.2-dev
+4.7.2-streamify-dev
index 52bc43aae85c054d03466c2e171f2f1bbfd7c8f1..a6a02a8e06205cb5996b0a94c1124056ce2cbf60 100644 (file)
@@ -174,7 +174,8 @@ public class SerialUtils {
                                                in.close();
                                        }
                                } finally {
-                                       encoded.close();
+                                       encoded.flush();
+                                       // Cannot close!
                                }
                        }
 
@@ -186,7 +187,9 @@ public class SerialUtils {
                        @Override
                        protected Object fromStream(InputStream in) throws IOException {
                                try {
-                                       return new Image(in);
+                                       // Cannot close it!
+                                       InputStream decoded = StringUtils.unbase64(in, false);
+                                       return new Image(decoded);
                                } catch (IOException e) {
                                        throw new UnknownFormatConversionException(e.getMessage());
                                }