Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 122dbbb6374f22125de2153046396093bd658850
https://github.com/WebKit/WebKit/commit/122dbbb6374f22125de2153046396093bd658850
Author: Said Abou-Hallawa <[email protected]>
Date: 2026-08-20 (Thu, 20 Aug 2026)
Changed paths:
M
LayoutTests/imported/w3c/web-platform-tests/webcodecs/image-decoder-image-orientation-none.https-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/webcodecs/image-decoder-utils.js
M
LayoutTests/imported/w3c/web-platform-tests/webcodecs/image-decoder.https.any-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/webcodecs/image-decoder.https.any.worker-expected.txt
R
LayoutTests/platform/glib/imported/w3c/web-platform-tests/webcodecs/image-decoder-image-orientation-none.https-expected.txt
M
LayoutTests/platform/glib/imported/w3c/web-platform-tests/webcodecs/image-decoder.https.any-expected.txt
M
LayoutTests/platform/glib/imported/w3c/web-platform-tests/webcodecs/image-decoder.https.any.worker-expected.txt
M Source/WebCore/Modules/webcodecs/WebCodecsImageDecoder.cpp
M Source/WebCore/platform/graphics/NativeImage.cpp
M Source/WebCore/platform/graphics/NativeImage.h
M Source/WebCore/platform/graphics/cg/NativeImageCG.cpp
M Source/WebCore/platform/graphics/cocoa/CVPixelBufferUtilities.cpp
M Source/WebCore/platform/graphics/cocoa/CVPixelBufferUtilities.h
M Source/WebCore/platform/graphics/cv/ImageRotationSessionVT.h
M Source/WebCore/platform/graphics/cv/ImageRotationSessionVT.mm
Log Message:
-----------
WebCodecsImageDecoder should rotate the decoded image based on its
ImageOrientation
https://bugs.webkit.org/show_bug.cgi?id=321707
rdar://184850407
Reviewed by Jean-Yves Avenard.
If the image has rotation EXIF data, WebCodecsImageDecoder needs to physically
rotate the image after it's decoded. For this purpose and for Apple ports,
ImageRotationSessionVT will be extended to apply ImageOrientation to a
NativeImage
using the existing VTImageRotationSession member. For non Apple ports a naive
approach is used for now. The image is drawn into an ImageBuffer with passing
the the desired ImageOrientation.
*
LayoutTests/imported/w3c/web-platform-tests/webcodecs/image-decoder-image-orientation-none.https-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/webcodecs/image-decoder-utils.js:
(int32ToByteArray):
(getColorName):
(toByteArray):
-- Add a tolerance of 1 for each channel when comparing two colors since the
JPEG
decompression can be lossy.
-- Always respect the orientation since the VideoFrame has a physically rotated
image. The orientation byte is already changed in the image encoded data. So the
color matrix has to be rotated according to the value of the orientation byte.
*
LayoutTests/imported/w3c/web-platform-tests/webcodecs/image-decoder.https.any-expected.txt:
*
LayoutTests/imported/w3c/web-platform-tests/webcodecs/image-decoder.https.any.worker-expected.txt:
*
LayoutTests/platform/glib/imported/w3c/web-platform-tests/webcodecs/image-decoder-image-orientation-none.https-expected.txt:
Removed.
*
LayoutTests/platform/glib/imported/w3c/web-platform-tests/webcodecs/image-decoder.https.any-expected.txt:
*
LayoutTests/platform/glib/imported/w3c/web-platform-tests/webcodecs/image-decoder.https.any.worker-expected.txt:
* Source/WebCore/Modules/webcodecs/WebCodecsImageDecoder.cpp:
(WebCore::WebCodecsImageDecoder::fulfillPendingDecodePromises):
* Source/WebCore/platform/graphics/NativeImage.h:
* Source/WebCore/platform/graphics/cg/NativeImageCG.cpp:
(WebCore::NativeImage::rotatedImage):
* Source/WebCore/platform/graphics/cocoa/CVPixelBufferUtilities.cpp:
(WebCore::createMetalCompatibleCVPixelBufferFromImage):
(WebCore::createCVPixelBufferFromImage):
* Source/WebCore/platform/graphics/cocoa/CVPixelBufferUtilities.h:
* Source/WebCore/platform/graphics/cv/ImageRotationSessionVT.h:
* Source/WebCore/platform/graphics/cv/ImageRotationSessionVT.mm:
(WebCore::ImageRotationSessionVT::rotate):
(WebCore::ImageRotationSessionVT::applyRotation):
* Source/WebCore/platform/graphics/NativeImage.cpp:
(WebCore::NativeImage::rotatedImage):
Canonical link: https://commits.webkit.org/319527@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications