diff --git a/libs/omggif/omggif-worker.js b/libs/omggif/omggif-worker.js index d293031..9712ecd 100644 --- a/libs/omggif/omggif-worker.js +++ b/libs/omggif/omggif-worker.js @@ -90,7 +90,7 @@ self.onmessage = function(event) { addFrame( frames[i] ); self.postMessage({ type: "progress", - data: Math.round( (i+1)/framesLength*100 ) + data: (i+1)/framesLength }); } @@ -106,4 +106,7 @@ self.onmessage = function(event) { frameCount: framesLength, encodeTime: Math.round( (Date.now()-startTime)/10 ) / 100 }); + + // Terminate self + self.close(); }; \ No newline at end of file diff --git a/src/nodes/variable-animation.js b/src/nodes/variable-animation.js index 040b5f6..ff8817f 100644 --- a/src/nodes/variable-animation.js +++ b/src/nodes/variable-animation.js @@ -245,7 +245,7 @@ $(function(){ var self = this; gifWorker.addEventListener('message', function (e) { if (e.data.type === "progress") { - self.$(".status").text("GIF " + e.data.data + "% encoded..."); + self.$(".status").text("GIF " + Math.round(e.data.data*100) + "% encoded..."); } else if (e.data.type === "gif") { var gifurl = "data:image/gif;base64,"+window.btoa(e.data.data); var img = $('') @@ -253,7 +253,14 @@ $(function(){ src: gifurl, style: "max-width:100%" }); - self.$(".exports").prepend( "