-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Disable strict pixi requirement for libavif >= 0.9.1 #7253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -342,6 +342,14 @@ gdImagePtr gdImageCreateFromAvifCtx (gdIOCtx *ctx) | |
|
||
decoder = avifDecoderCreate(); | ||
|
||
// Check if libavif version is >= 0.9.1 | ||
#if AVIF_VERSION_MAJOR > 0 || (AVIF_VERSION_MAJOR == 0 && AVIF_VERSION_MINOR > 9) || (AVIF_VERSION_MAJOR == 0 && AVIF_VERSION_MINOR == 9 && AVIF_VERSION_PATCH >= 1) | ||
// If so, allow the PixelInformationProperty ('pixi') to be missing in AV1 image | ||
// items. libheif v1.11.0 or older does not add the 'pixi' item property to | ||
// AV1 image items. (This issue has been corrected in libheif v1.12.0.) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it possible to link with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. got a test failure when There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it due to just some minor variation of pixels? In that case we probably should use similarity.inc for the comparison. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did you use a different encoder than For libgd, we decided to use About There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @morsssss thank you! I used to build There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Both the PR and bb9ef2b still shows failures on arm (guess it caused by 32-bits) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test passes on 32bit Windows with libavif 0.9.0; so either it's only an issue with newer libavif, or not particularly 32bit related at all. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Still fails on armv7 and armhf using beta2 (libavif 0.9.2)
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @andypost , please see the thread below. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @morsssss FYI using patch to build libavif AOMediaCodec/libavif@1556f21 allowed to pass tests) |
||
decoder->strictFlags &= ~AVIF_STRICT_PIXI_REQUIRED; | ||
#endif | ||
|
||
io = createAvifIOFromCtx(ctx); | ||
if (!io) { | ||
gd_error("avif error - Could not allocate memory"); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this version based conditional compilation necessary? Can't we just always exclude this flag? If
AVIF_STRICT_PIXI_REQUIRED
is only available as of 0.9.2, we could check whether it is defined instead of checking the version.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Christoph,
AVIF_STRICT_PIXI_REQUIRED is defined as an enumerator, not as a macro. So we can't say
#if defined(AVIF_STRICT_PIXI_REQUIRED)
The version check could be simplified if necessary by packing major, minor, and patch into an integer and compare the integers. For example,
This assumes the way
AVIF_VERSION
is defined in <avif/avif.h> will never change:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, then the version check is fine for me.