GithubHelp home page GithubHelp logo

Comments (5)

eight04 avatar eight04 commented on July 22, 2024

Yes, you can specify repeat count in APNG. In this library, the repeat count is always 0 (infinite):

out.append(make_chunk("acTL", struct.pack("!II", len(self.frames), 0)))

And it is ignored when reading frames from an APNG file:

pyAPNG/apng/__init__.py

Lines 347 to 348 in aeb6973

elif type == "acTL":
continue

I think we should expose it as a public property num_plays of APNG instance.

from pyapng.

borisdering avatar borisdering commented on July 22, 2024

Wow! thank you for the very fast reply. The way to pass this argument would be amazing and would solve my issue. Anyways, how should we move on? I'm pretty new to python and especially to APNG. Should I make the changes or would you like to go ahead?

from pyapng.

eight04 avatar eight04 commented on July 22, 2024

PRs welcome. I would expect something like:

im = APNG.from_files(some_files)
assert im.num_plays == 0
im.num_plays = 5
im.save(result_file) # the result animation should only repeat 5 times

im = APNG.open(result_file)
assert im.num_plays == 5

from pyapng.

 avatar commented on July 22, 2024

pyAPNG works great, and I do like it a lot.

Regarding #4, could you add a code example to the documtation, how an infinite repeat as well as only-play-once of the animation should be written? Thanks in advance!

from pyapng.

eight04 avatar eight04 commented on July 22, 2024

APNG object has a num_plays property. You can modify this property before writing APNG to file.

from pyapng.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.