Skip to content

Commit

Permalink
AvifLoader: Fix build with pre-1.0 libavif
Browse files Browse the repository at this point in the history
  • Loading branch information
hpjansson committed Sep 15, 2023
1 parent b685369 commit 919d8fc
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tools/chafa/avif-loader.c
Expand Up @@ -78,6 +78,7 @@ maybe_decode_frame (AvifLoader *loader)
avifResult avif_result;
avifImage *image;
avifRGBImage rgb;
guint axis;

if (loader->frame_is_decoded)
return loader->frame_is_success;
Expand Down Expand Up @@ -106,11 +107,18 @@ maybe_decode_frame (AvifLoader *loader)
g_free (loader->frame_data);
loader->frame_data = rgb.pixels;

#if AVIF_VERSION_MAJOR >= 1
axis = image->imir.axis;
#else
axis = image->imir.mode;
#endif

rotate_image ((guchar **) &loader->frame_data,
&loader->width, &loader->height,
&loader->rowstride, N_CHANNELS,
calc_rotation (image->transformFlags,
image->irot.angle, image->imir.axis));
image->irot.angle,
axis));

out:
return loader->frame_is_success;
Expand Down

0 comments on commit 919d8fc

Please sign in to comment.