#29 Python C-Extension Support

pending
nobody
None
5
2013-12-28
2012-01-29
juntalis
No

I wrote up a simple wrapped around the existing engine to implement optipng as a Python C-Extension. I made minimal changes to the existing source, but nothing that actually changes the output of complining optipng itself. (A few preprocessor conditionals in the optipng.h header to remove some members of the opng_options struct that are only used in the main optipng.c file)

It's still a major WIP, but I figured I'd offer it and see if you were interested. I have a repository set up at https://github.com/Juntalis/PyOptiPng for the time being. Thanks.

Discussion

  • Cosmin Truta

    Cosmin Truta - 2012-04-10
    • status: open --> open
     
  • Cosmin Truta

    Cosmin Truta - 2012-04-10

    Hello, Charles,

    I finally had a look at your work, and I appreciate it very much.

    I would be interested indeed in having Python bindings, but the 0.6.x/0.7.x line won't be updated for too long. As soon as OptiPNG-Hg is finalized and promoted to v1.0, the interface that you just ported to Python will be deprecated. So if you grab the development branch from
    http://optipng.hg.sourceforge.net/hgweb/optipng/optipng
    and build Python bindings on top of that, I will be interested to adding it to the main source tree.

     
  • juntalis

    juntalis - 2012-04-10

    Really busy at the moment with a number of different projects for work, but once my schedule clears up a bit, I'll get started on the updates. Ideally, I'd like to write the bindings in pure C, rather than relying on helpers like swig or cython, but we'll just have to see.

    Just out of curiosity (and I can always just find out myself when I go to work on this), is the engine still more of a "single instance" type of ordeal, or do you think i'll be able to wrap it up as a Python class and allow for multiple instances?

     
  • juntalis

    juntalis - 2012-04-10

    Really busy at the moment with a number of different projects for work, but once my schedule clears up a bit, I'll get started on the updates. Ideally, I'd like to write the bindings in pure C, rather than relying on helpers like swig or cython, but we'll just have to see.

    Just out of curiosity (and I can always just find out myself when I go to work on this), is the engine still more of a "single instance" type of ordeal, or do you think i'll be able to wrap it up as a Python class and allow for multiple instances?

     
  • juntalis

    juntalis - 2012-04-10
    • status: pending --> pending
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks