Coder Social home page Coder Social logo

Add SVG support about imv HOT 5 CLOSED

exec64 avatar exec64 commented on August 16, 2024
Add SVG support

from imv.

Comments (5)

siiptuo avatar siiptuo commented on August 16, 2024

I would find this feature very useful.

The best option to implement it would probably be librsvg because it's quite popular and feature complete. However it comes with many dependencies to GNOME libraries like Cairo and GLib.

Alternatively nanosvg could be considered but its features, especially rasterization, isn't as good as in librsvg. I believe that in this case image quality and correctness is more important than code size.

There are some other libraries out there but these two look like the only complete and active ones. There are naturally other open source implementations but they are not available as simple standalone libraries.

Of course the whole SVG support could be an optional feature or even support multiple libraries.

from imv.

ddevault avatar ddevault commented on August 16, 2024

👍

from imv.

eXeC64 avatar eXeC64 commented on August 16, 2024

SVG is a very tempting format to support. I don't have any plans to implement support for multiple back ends in imv, but I'd consider patches.

This could be done in two parts:

1. Wrapping existing use of FIBITMAP in a struct.

  • Updating imv_loader to return the new struct
  • Updating imv_texture to load the struct
  • Providing a function to properly destroy the struct

2. Creating a loader interface

  • Adapting the existing one to be the 'FreeImage' loader.
  • Have a table/list of loaders, routing to them based on file type.
  • Implement new loaders (one for SVG, etc.)

This raises the possibility to escape GPLv2 long term too. At present there have been 10 code contributors since being forced to license GPLv2, 5 of whom I know would agree to MIT licensing of their contributions, or have already done so. 4 of the other contributors only have one line changes.

Getting proper authorisation shouldn't be an issue.

from imv.

eXeC64 avatar eXeC64 commented on August 16, 2024

I've merged changes to master that resolve this issue: Support for multiple backends, with a librsvg backend.

from imv.

ddevault avatar ddevault commented on August 16, 2024

Thanks!

from imv.

Related Issues (20)

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.