vi / imlib2-avif

AVIF loader for Imlib2/feh
5 stars 0 forks source link

error when building #3

Open ghost opened 3 years ago

ghost commented 3 years ago

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
eworm-de commented 2 years ago

This is caused by API changes in libavfi... I made it compile (though not sure if all changes are correct). Looks like imlib2 is not interested in using the new loader... Any more steps required other than copying the shared library?

Edit: My issue was feh not knowing about avif... It has to be started with FEH_SKIP_MAGIC=1. Still fails to load the image, but I will try to find some time to fix this.