Prefer use of vips_interpretation_max_alpha()

This also ensures we handle scRGB correctly, see:
e9c5a31552
This commit is contained in:
Kleis Auke Wolthuizen
2025-05-13 17:12:23 +02:00
committed by Lovell Fuller
parent 94481a967e
commit 8e17c6f518
3 changed files with 2 additions and 16 deletions

View File

@@ -60,7 +60,7 @@ class StatsWorker : public Napi::AsyncWorker {
// Image is not opaque when alpha layer is present and contains a non-mamixa value
if (image.has_alpha()) {
double const minAlpha = static_cast<double>(stats.getpoint(STAT_MIN_INDEX, bands).front());
if (minAlpha != sharp::MaximumImageAlpha(image.interpretation())) {
if (minAlpha != vips_interpretation_max_alpha(image.interpretation())) {
baton->isOpaque = false;
}
}