Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@mmulet
Copy link
Contributor

@mmulet mmulet commented Nov 3, 2020

Hello!
I think viu is great! I needed to adjust the frame-rate, so I modified the code to allow this.
I'm just sharing my changes, use them if you want or don't, doesn't make a difference to me.

On a side note, there should be a way to read the frame rate from the .gif itself, but I don't use Rust daily and I don't know what the API is.
Cheers!

This is how animated .gifs encode frame_rate/fps information.
they encode the delay between each individual frame.
@mmulet
Copy link
Contributor Author

mmulet commented Nov 4, 2020

Found the API for .gif playback. In .gif's each frame encodes how long you should wait (in milliseconds to delay the frame). So now I default to that behavior, unless the user overrides it with --frame_rate argument.
However, if the gif doesn't have delay information, it plays without a delay (as fast as possible). I don't know if this is desired behavior or not, it would be trivial to add a 30 ms delay, in the case of all delays being zero, so let me know.

Copy link
Owner

@atanunq atanunq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi!
Thank you very much for contributing, this is a great feature. Can you update the readme with the new flag and it's good to go

@mmulet
Copy link
Contributor Author

mmulet commented Nov 4, 2020

Sure no prob. I can do that later today.

@atanunq
Copy link
Owner

atanunq commented Nov 4, 2020

Great, thank you!

@atanunq atanunq merged commit 77b71a9 into atanunq:master Nov 4, 2020
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

Successfully merging this pull request may close these issues.

2 participants