Ensure removeAlpha removes all alpha channels #2266

This commit is contained in:
Lovell Fuller
2025-02-20 09:26:52 +00:00
parent 9d01dd20bf
commit edad89c531
10 changed files with 33 additions and 46 deletions

View File

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