Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Iteration #33

Open
siddharthnaik7 opened this issue Jan 30, 2017 · 3 comments
Open

Iteration #33

siddharthnaik7 opened this issue Jan 30, 2017 · 3 comments

Comments

@siddharthnaik7
Copy link

Hi, I am trying to iterate the GIF only once. I am setting repeat = null for the same, which renders me the gif with only one iteration. This works well on pc browser. But when I save the image and export to my smart phone the default gif launcher of the phone, iterates the gif infinitely. How can I achieve a single iteration?

@sole
Copy link
Owner

sole commented Feb 21, 2017

It might be an issue with the GIF player in the phone if it works nicely in the browser. Can you provide an example image or code that generates the image?

@siddharthnaik7
Copy link
Author

siddharthnaik7 commented Feb 24, 2017

Hi,

I have written the following code:

$scope.CreateGIF = function (){ var delay=100; function run(){ if(ol>=op) return; var objDiv = cc[ol][0].childNodes[1]; html2canvas(objDiv, { onrendered: function(canvas) { var imgElem = document.createElement("img"); var pngImage = canvas.toDataURL("img/png"); imgElem.setAttribute('src',pngImage); ag.addFrame(imgElem); } }); if(ol < op){ if(ol==(op-1)){ sid = true; } ol++; setTimeout(run, delay); console.log("After timeout......"); } console.log("After if ol<op"); } run(); console.log("After run......"); return false; }

and used following to generate the gif,

ag.getBase64GIF(function(image) { console.log("After Entering getBase64gif " + image); });

Also, please find attached the gif that I am trying to get.

This gif will work for single interation on laptop/pc browsers, but when you transfer to your smart phone, and view it in your default phone gallery, it will iterate continuously.

Kindly, let me know if there is any solution or way out for this issue.

(One other thing, how can we increase the gif speed, i.e frame rate, As, you can see, the gif frame speed/interval speed is very slow)

Thanks - Siddharth
dodo

@siddharthnaik7
Copy link
Author

Hi,

Also, I am capturing 121 images(64-bit-png-data-urls) from the animation and passing these urls sequentially to addframe() function.
Is this process causing the gif to run slowly? ( I have kept delay 0).

Kindly, guide me on this too.

Thanks - Siddharth

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants