mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-19 20:19:05 +00:00
Fix alpha channel in encoder
This commit is contained in:
@@ -6,9 +6,9 @@ CODEC_OUT := $(addprefix $(CODEC_DIR)/, $(CODEC_OUT_RELATIVE))
|
||||
|
||||
CODEC_VERSION = "v0.8.0"
|
||||
|
||||
LIBAOM_RELATIVE = ./ext/aom/build.libavif/
|
||||
LIBAOM_RELATIVE = ext/aom/
|
||||
LIBAOM_DIR := $(addprefix $(CODEC_DIR)/, $(LIBAOM_RELATIVE))
|
||||
LIBAOM_OUT_RELATIVE = ./libaom.a
|
||||
LIBAOM_OUT_RELATIVE = build.libavif/libaom.a
|
||||
LIBAOM_OUT := $(addprefix $(LIBAOM_DIR)/, $(LIBAOM_OUT_RELATIVE))
|
||||
|
||||
LIBAOM_VERSION = "v2.0.0"
|
||||
@@ -35,8 +35,8 @@ all: $(OUT_JS)
|
||||
|
||||
$(LIBAOM_OUT): $(LIBAOM_DIR)
|
||||
export CFLAGS="-w $(CFLAGS)" && \
|
||||
mkdir -p $(LIBAOM_DIR) && \
|
||||
cd $(LIBAOM_DIR) && \
|
||||
mkdir -p $(LIBAOM_DIR)/build.avif && \
|
||||
cd $(LIBAOM_DIR)/build.avif && \
|
||||
emcmake cmake \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DENABLE_CCACHE=0 \
|
||||
|
||||
@@ -55,7 +55,7 @@ val encode(std::string buffer, int width, int height, AvifOptions options) {
|
||||
pixel[0] = rgba[pixelOffset * 4 + 0];
|
||||
pixel[1] = rgba[pixelOffset * 4 + 1];
|
||||
pixel[2] = rgba[pixelOffset * 4 + 2];
|
||||
pixel[3] = rgba[pixelOffset * 4 + 0];
|
||||
pixel[3] = rgba[pixelOffset * 4 + 3];
|
||||
}
|
||||
}
|
||||
avifImageRGBToYUV(image, &srcRGB);
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user