summaryrefslogtreecommitdiff
path: root/pkg/wuffs/src/jpeg.zig
diff options
context:
space:
mode:
authorQwerasd <qwerasd205@users.noreply.github.com>2025-01-17 13:28:14 -0500
committerQwerasd <qwerasd205@users.noreply.github.com>2025-01-17 14:38:38 -0500
commitc2da843dfdcbe74fa1db8a676bb6e76d76621ee6 (patch)
tree0f78c13e66b61ad931f884fab80cd6001b5b7168 /pkg/wuffs/src/jpeg.zig
parent72d085525b22d66468c5969a4d507a0fa68d4a04 (diff)
fix(wuffs): don't premul alpha when loading images
It seems like the raw data version of the kitty graphics transmit operation is meant to be unassociated (aka straight) alpha, though I can't find any definitive documentation either way- but in any case unassociated alpha is more common in image formats and makes the handling easier for the rest of it. Also removed a redundant call to `decode_frame_config`, since it's called implicitly when we call `decode_frame` right after.
Diffstat (limited to 'pkg/wuffs/src/jpeg.zig')
-rw-r--r--pkg/wuffs/src/jpeg.zig12
1 files changed, 1 insertions, 11 deletions
diff --git a/pkg/wuffs/src/jpeg.zig b/pkg/wuffs/src/jpeg.zig
index 69628f582..c07278eed 100644
--- a/pkg/wuffs/src/jpeg.zig
+++ b/pkg/wuffs/src/jpeg.zig
@@ -55,7 +55,7 @@ pub fn decode(alloc: Allocator, data: []const u8) Error!ImageData {
c.wuffs_base__pixel_config__set(
&image_config.pixcfg,
- c.WUFFS_BASE__PIXEL_FORMAT__RGBA_PREMUL,
+ c.WUFFS_BASE__PIXEL_FORMAT__RGBA_NONPREMUL,
c.WUFFS_BASE__PIXEL_SUBSAMPLING__NONE,
width,
height,
@@ -95,16 +95,6 @@ pub fn decode(alloc: Allocator, data: []const u8) Error!ImageData {
try check(log, &status);
}
- var frame_config: c.wuffs_base__frame_config = undefined;
- {
- const status = c.wuffs_jpeg__decoder__decode_frame_config(
- decoder,
- &frame_config,
- &source_buffer,
- );
- try check(log, &status);
- }
-
{
const status = c.wuffs_jpeg__decoder__decode_frame(
decoder,