Loader for avif for Imlib2 (i.e. for Feh). Based on libavif.
- Ensure Imlib2 development things (like
libimlib2-dev
) are installed; - Install avif and dav1d to
/opt/avif/{include,lib/x86_64-linux-gnu}
- Build and install (somehow)
avif.so
.
AVIF loader for Imlib2/feh
I'm sure I've missed something, but I wonder if you could help me to figure this out.
Using Debian 11 64-bit.
I've installed all the libraries and dev packages.
This is the output I get
gcc -Wp,-MMD,loader_avif.d -c -std=c99 -O3 -I/opt/avif/include -fPIC -Wall -ggdb -o loader_avif.o loader_avif.c
In file included from /usr/include/x86_64-linux-gnu/sys/types.h:25,
from loader_avif.c:35:
/usr/include/features.h:187:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]
187 | # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
| ^~~~~~~
loader_avif.c: In function ‘load’:
loader_avif.c:78:3: error: unknown type name ‘avifRawData’; did you mean ‘avifRWData’?
78 | avifRawData raw = AVIF_RAW_DATA_EMPTY;
| ^~~~~~~~~~~
| avifRWData
loader_avif.c:78:21: error: ‘AVIF_RAW_DATA_EMPTY’ undeclared (first use in this function); did you mean ‘AVIF_DATA_EMPTY’?
78 | avifRawData raw = AVIF_RAW_DATA_EMPTY;
| ^~~~~~~~~~~~~~~~~~~
| AVIF_DATA_EMPTY
loader_avif.c:78:21: note: each undeclared identifier is reported only once for each function it appears in
loader_avif.c:79:3: warning: implicit declaration of function ‘avifRawDataRealloc’; did you mean ‘avifRWDataRealloc’? [-Wimplicit-function-declaration]
79 | avifRawDataRealloc(&raw, inputFileSize);
| ^~~~~~~~~~~~~~~~~~
| avifRWDataRealloc
loader_avif.c:80:16: error: request for member ‘data’ in something not a structure or union
80 | if (fread(raw.data, 1, inputFileSize, inputFile) != inputFileSize) {
| ^
loader_avif.c:83:7: warning: implicit declaration of function ‘avifRawDataFree’; did you mean ‘avifRWDataFree’? [-Wimplicit-function-declaration]
83 | avifRawDataFree(&raw);
| ^~~~~~~~~~~~~~~
| avifRWDataFree
loader_avif.c:90:29: error: too many arguments to function ‘avifDecoderRead’
90 | avifResult decodeResult = avifDecoderRead(decoder, avif, &raw);
| ^~~~~~~~~~~~~~~
In file included from loader_avif.c:49:
/opt/avif/include/avif/avif.h:718:21: note: declared here
718 | AVIF_API avifResult avifDecoderRead(avifDecoder * decoder, avifImage * image); // call avifDecoderSetIO*() first
| ^~~~~~~~~~~~~~~
loader_avif.c:118:14: error: ‘avifImage’ has no member named ‘rgbPlanes’; did you mean ‘yuvPlanes’?
118 | if (!avif->rgbPlanes[0]) {
| ^~~~~~~~~
| yuvPlanes
loader_avif.c:119:31: error: too few arguments to function ‘avifImageYUVToRGB’
119 | avifResult convResult = avifImageYUVToRGB(avif);
| ^~~~~~~~~~~~~~~~~
In file included from loader_avif.c:49:
/opt/avif/include/avif/avif.h:497:21: note: declared here
497 | AVIF_API avifResult avifImageYUVToRGB(const avifImage * image, avifRGBImage * rgb);
| ^~~~~~~~~~~~~~~~~
loader_avif.c:147:45: error: ‘avifImage’ has no member named ‘rgbPlanes’; did you mean ‘yuvPlanes’?
147 | bgra[4*(y*w + x) + 0] = avif->rgbPlanes[AVIF_CHAN_B][y * avif->rgbRowBytes[AVIF_CHAN_B] + x];
| ^~~~~~~~~
| yuvPlanes
loader_avif.c:147:78: error: ‘avifImage’ has no member named ‘rgbRowBytes’; did you mean ‘yuvRowBytes’?
147 | bgra[4*(y*w + x) + 0] = avif->rgbPlanes[AVIF_CHAN_B][y * avif->rgbRowBytes[AVIF_CHAN_B] + x];
| ^~~~~~~~~~~
| yuvRowBytes
loader_avif.c:148:45: error: ‘avifImage’ has no member named ‘rgbPlanes’; did you mean ‘yuvPlanes’?
148 | bgra[4*(y*w + x) + 1] = avif->rgbPlanes[AVIF_CHAN_G][y * avif->rgbRowBytes[AVIF_CHAN_G] + x];
| ^~~~~~~~~
| yuvPlanes
loader_avif.c:148:78: error: ‘avifImage’ has no member named ‘rgbRowBytes’; did you mean ‘yuvRowBytes’?
148 | bgra[4*(y*w + x) + 1] = avif->rgbPlanes[AVIF_CHAN_G][y * avif->rgbRowBytes[AVIF_CHAN_G] + x];
| ^~~~~~~~~~~
| yuvRowBytes
loader_avif.c:149:45: error: ‘avifImage’ has no member named ‘rgbPlanes’; did you mean ‘yuvPlanes’?
149 | bgra[4*(y*w + x) + 2] = avif->rgbPlanes[AVIF_CHAN_R][y * avif->rgbRowBytes[AVIF_CHAN_R] + x];
| ^~~~~~~~~
| yuvPlanes
loader_avif.c:149:78: error: ‘avifImage’ has no member named ‘rgbRowBytes’; did you mean ‘yuvRowBytes’?
149 | bgra[4*(y*w + x) + 2] = avif->rgbPlanes[AVIF_CHAN_R][y * avif->rgbRowBytes[AVIF_CHAN_R] + x];
| ^~~~~~~~~~~
| yuvRowBytes
loader_avif.c:157:45: error: ‘avifImage’ has no member named ‘rgbPlanes’; did you mean ‘yuvPlanes’?
157 | bgra[4*(y*w + x) + 0] = avif->rgbPlanes[AVIF_CHAN_B][y * avif->rgbRowBytes[AVIF_CHAN_B] + x];
| ^~~~~~~~~
| yuvPlanes
loader_avif.c:157:78: error: ‘avifImage’ has no member named ‘rgbRowBytes’; did you mean ‘yuvRowBytes’?
157 | bgra[4*(y*w + x) + 0] = avif->rgbPlanes[AVIF_CHAN_B][y * avif->rgbRowBytes[AVIF_CHAN_B] + x];
| ^~~~~~~~~~~
| yuvRowBytes
loader_avif.c:158:45: error: ‘avifImage’ has no member named ‘rgbPlanes’; did you mean ‘yuvPlanes’?
158 | bgra[4*(y*w + x) + 1] = avif->rgbPlanes[AVIF_CHAN_G][y * avif->rgbRowBytes[AVIF_CHAN_G] + x];
| ^~~~~~~~~
| yuvPlanes
loader_avif.c:158:78: error: ‘avifImage’ has no member named ‘rgbRowBytes’; did you mean ‘yuvRowBytes’?
158 | bgra[4*(y*w + x) + 1] = avif->rgbPlanes[AVIF_CHAN_G][y * avif->rgbRowBytes[AVIF_CHAN_G] + x];
| ^~~~~~~~~~~
| yuvRowBytes
loader_avif.c:159:45: error: ‘avifImage’ has no member named ‘rgbPlanes’; did you mean ‘yuvPlanes’?
159 | bgra[4*(y*w + x) + 2] = avif->rgbPlanes[AVIF_CHAN_R][y * avif->rgbRowBytes[AVIF_CHAN_R] + x];
| ^~~~~~~~~
| yuvPlanes
loader_avif.c:159:78: error: ‘avifImage’ has no member named ‘rgbRowBytes’; did you mean ‘yuvRowBytes’?
159 | bgra[4*(y*w + x) + 2] = avif->rgbPlanes[AVIF_CHAN_R][y * avif->rgbRowBytes[AVIF_CHAN_R] + x];
| ^~~~~~~~~~~
| yuvRowBytes
make: *** [makefile:29: loader_avif.o] Error 1
libheif now includes support for AVIF. Perhaps it has advantages over libavif. ImageMagick opted for libheif.
I see that you mention BSD (3-clause) in your source code files. Could you please add a LICENSE file too?
That would make it easier to package this into Arch (AUR).
Adding a tag as you did with imlib2-heic would also be helpful.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.