Closed iainlane closed 3 years ago
btw I think that crashing is kind of dodgy behaviour. Should asc_globals_set_use_optipng
be lookng at priv->optipng_bin
and refusing to set to TRUE
if that is NULL
(logging a critical)?
btw I think that crashing is kind of dodgy behaviour. Should asc_globals_set_use_optipng be lookng at priv->optipng_bin and refusing to set to TRUE if that is NULL (logging a critical)?
Oh, it absolutely should do that! Crashing is never acceptable (unless it's an assertion in tests or a g_error
in other code).
Thanks for the patch!
Currently we tell AsCompose to use optipng just based on the value of the feature flag. AsCompose will respect what we tell it without further checking. If optipng is in fact not available then we'll crash later on when we first try to use it.
Fix this by setting the flag after we check if optipng is installed.