eXeC64 / imv

Image viewer for X11/Wayland
MIT License
799 stars 58 forks source link

Add libnsgif backend #145

Closed eXeC64 closed 5 years ago

eXeC64 commented 5 years ago

http://www.netsurf-browser.org/projects/libnsgif/

It's licensed under MIT, making it a nice permissive alternative to FreeImage.

n3f4s commented 5 years ago

Hi,

I started studying libnsgif and imv's backend structure.

Is there some doc on imv's backend structure (imv_backend, imv_source, ...)? EDIT: found the doc.

eXeC64 commented 5 years ago

I haven't documented it, but the gist is that a backend is a wrapper for a specific library or implementation that, if able, creates a "source" for a given path or blob of data.

A source is an object that represents an open handle on an image. It emits bitmaps on demand, abstracting away all implementation details of a given backend.

If you have better name ideas or tweaks you want to make I'm open minded. The names were a result of me not being able to think of something better that didn't conflict with names I'd already used.

​​​​​​

n3f4s commented 5 years ago

I'm not familiar with imv's code or with libraries like freeimage. I was trying to understand how to write a backend without having to read an other backend (and having to read freeimage doc). The comments from backend.h and source.h are enough (at least for now, I may have some more digging to do ^^).

It could be nice to have a quick description (outside of the comments) of how imv_source et imv_backend work and how they are used. It would make it easier for someone not familiar with imv to create a new backend.

eXeC64 commented 5 years ago

Implemented by a6deca0. Closing.