fune/testing/web-platform/tests/webcodecs/image-decoder-image-orientation-none.https.html
Dale Curtis 8e6db535b2 Bug 1778685 [wpt PR 34737] - [WebCodecs] Ensure orientation is set on YUV image decodes., a=testonly
Automatic update from web-platform-tests
[WebCodecs] Ensure orientation is set on YUV image decodes.

While the RGB decoding path was always setting the orientation, it
was overlooked on the YUV decoding path. As such, this change adds
code to set it and tests to ensure it doesn't regress.

Fixed: 1342672
Change-Id: I7b8f7f05502a040525cc84fc60f2dd12a42211c0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3751369
Reviewed-by: Thomas Guilbert <tguilbert@chromium.org>
Commit-Queue: Thomas Guilbert <tguilbert@chromium.org>
Auto-Submit: Dale Curtis <dalecurtis@chromium.org>
Commit-Queue: Dale Curtis <dalecurtis@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1021792}

--

wpt-commits: 8016ebe321801a0a80e948b8dbb75b9cc0109ac5
wpt-pr: 34737
2022-07-13 15:05:51 +00:00

88 lines
3.5 KiB
HTML

<!DOCTYPE html>
<title>Test ImageDecoder outputs to a image-orientation: none canvas.</title>
<canvas style="image-orientation: none"></canvas>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/webcodecs/image-decoder-utils.js"></script>
<script>
promise_test(t => {
return testFourColorDecodeWithExifOrientation(
1, document.querySelector('canvas'));
}, 'Test JPEG w/ EXIF orientation top-left on canvas w/o orientation');
promise_test(t => {
return testFourColorDecodeWithExifOrientation(
2, document.querySelector('canvas'));
}, 'Test JPEG w/ EXIF orientation top-right on canvas w/o orientation.');
promise_test(t => {
return testFourColorDecodeWithExifOrientation(
3, document.querySelector('canvas'));
}, 'Test JPEG w/ EXIF orientation bottom-right on canvas w/o orientation.');
promise_test(t => {
return testFourColorDecodeWithExifOrientation(
4, document.querySelector('canvas'));
}, 'Test JPEG w/ EXIF orientation bottom-left on canvas w/o orientation.');
promise_test(t => {
return testFourColorDecodeWithExifOrientation(
5, document.querySelector('canvas'));
}, 'Test JPEG w/ EXIF orientation left-top on canvas w/o orientation.');
promise_test(t => {
return testFourColorDecodeWithExifOrientation(
6, document.querySelector('canvas'));
}, 'Test JPEG w/ EXIF orientation right-top on canvas w/o orientation.');
promise_test(t => {
return testFourColorDecodeWithExifOrientation(
7, document.querySelector('canvas'));
}, 'Test JPEG w/ EXIF orientation right-bottom on canvas w/o orientation.');
promise_test(t => {
return testFourColorDecodeWithExifOrientation(
8, document.querySelector('canvas'));
}, 'Test JPEG w/ EXIF orientation left-bottom on canvas w/o orientation.');
// YUV tests
promise_test(t => {
return testFourColorDecodeWithExifOrientation(
1, document.querySelector('canvas'), /*useYuv=*/true);
}, 'Test 4:2:0 JPEG w/ EXIF orientation top-left on canvas w/o orientation');
promise_test(t => {
return testFourColorDecodeWithExifOrientation(
2, document.querySelector('canvas'), /*useYuv=*/true);
}, 'Test 4:2:0 JPEG w/ EXIF orientation top-right on canvas w/o orientation.');
promise_test(t => {
return testFourColorDecodeWithExifOrientation(
3, document.querySelector('canvas'), /*useYuv=*/true);
}, 'Test 4:2:0 JPEG w/ EXIF orientation bottom-right on canvas w/o orientation.');
promise_test(t => {
return testFourColorDecodeWithExifOrientation(
4, document.querySelector('canvas'), /*useYuv=*/true);
}, 'Test 4:2:0 JPEG w/ EXIF orientation bottom-left on canvas w/o orientation.');
promise_test(t => {
return testFourColorDecodeWithExifOrientation(
5, document.querySelector('canvas'), /*useYuv=*/true);
}, 'Test 4:2:0 JPEG w/ EXIF orientation left-top on canvas w/o orientation.');
promise_test(t => {
return testFourColorDecodeWithExifOrientation(
6, document.querySelector('canvas'), /*useYuv=*/true);
}, 'Test 4:2:0 JPEG w/ EXIF orientation right-top on canvas w/o orientation.');
promise_test(t => {
return testFourColorDecodeWithExifOrientation(
7, document.querySelector('canvas'), /*useYuv=*/true);
}, 'Test 4:2:0 JPEG w/ EXIF orientation right-bottom on canvas w/o orientation.');
promise_test(t => {
return testFourColorDecodeWithExifOrientation(
8, document.querySelector('canvas'), /*useYuv=*/true);
}, 'Test 4:2:0 JPEG w/ EXIF orientation left-bottom on canvas w/o orientation.');
</script>