Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/webp.imageio/webpinput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,11 @@ WebpInput::open(const std::string& name, ImageSpec& spec,
// Make space for the decoded image
m_decoded_image.reset(new uint8_t[m_spec.image_bytes()]);

if (config.get_int_attribute("oiio:UnassociatedAlpha", 0) == 1)
if (config.get_int_attribute("oiio:UnassociatedAlpha", 0) == 1) {
m_keep_unassociated_alpha = true;
if (m_spec.alpha_channel != -1)
m_spec.attribute("oiio:UnassociatedAlpha", 1);
}

seek_subimage(0, 0);
spec = m_spec;
Expand Down
6 changes: 6 additions & 0 deletions testsuite/webp/ref/out-webp1.1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,9 @@ Reading ../oiio-images/webp/4.webp
SHA-1: 8F42E3DCCE6FE15146BA06C440C15B7831F60572
channel list: R, G, B
oiio:ColorSpace: "srgb_rec709_scene"
Reading rgba.webp
rgba.webp : 64 x 64, 4 channel, uint8 webp
SHA-1: 897256B6709E1A4DA9DABA92B6BDE39CCFCCD8C1
channel list: R, G, B, A
oiio:ColorSpace: "srgb_rec709_scene"
oiio:UnassociatedAlpha: 1
3 changes: 3 additions & 0 deletions testsuite/webp/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@
# a lossy format and is not stable under the round trip
# command += rw_command (OIIO_TESTSUITE_IMAGEDIR, f,
# extraargs='-attrib compression lossless')

command += oiiotool ("--create 64x64 4 -o rgba.webp")
command += info_command ("rgba.webp", "--iconfig oiio:UnassociatedAlpha 1", safematch=True)
Loading