Bug 386651 - Need regression tests for PNG image decoding. [Part 5, done!]
|
@ -16,6 +16,8 @@ to a pure HTML representation (no images).</p>
|
||||||
|
|
||||||
<form onsubmit="start_convert(); return false;">
|
<form onsubmit="start_convert(); return false;">
|
||||||
Path to image: <input type="text" id="filepath" size="60"><br>
|
Path to image: <input type="text" id="filepath" size="60"><br>
|
||||||
|
<input id="fill" type="checkbox">
|
||||||
|
Fill canvas with <input id="fillRGB" value="rgb(10,100,250)"> (instead of transparency).<br>
|
||||||
<button type='submit'>Convert!</button>
|
<button type='submit'>Convert!</button>
|
||||||
<br><br>
|
<br><br>
|
||||||
<img id="img" onload="run_convert();"><canvas id="canvas"></canvas><span id="span"></span><br>
|
<img id="img" onload="run_convert();"><canvas id="canvas"></canvas><span id="span"></span><br>
|
||||||
|
@ -31,6 +33,8 @@ var img = document.getElementById("img");
|
||||||
var canvas = document.getElementById("canvas");
|
var canvas = document.getElementById("canvas");
|
||||||
var span = document.getElementById("span");
|
var span = document.getElementById("span");
|
||||||
var textarea = document.getElementById("textarea");
|
var textarea = document.getElementById("textarea");
|
||||||
|
var fill = document.getElementById("fill");
|
||||||
|
var fillRGB = document.getElementById("fillRGB");
|
||||||
|
|
||||||
function start_convert() {
|
function start_convert() {
|
||||||
try {
|
try {
|
||||||
|
@ -64,6 +68,10 @@ function run_convert() {
|
||||||
canvas.height = img.height;
|
canvas.height = img.height;
|
||||||
var ctx = canvas.getContext("2d");
|
var ctx = canvas.getContext("2d");
|
||||||
ctx.clearRect(0, 0, img.width, img.height);
|
ctx.clearRect(0, 0, img.width, img.height);
|
||||||
|
if (fill.checked) {
|
||||||
|
ctx.fillStyle = fillRGB.value;
|
||||||
|
ctx.fillRect (0, 0, img.width, img.height);
|
||||||
|
}
|
||||||
ctx.drawImage(img, 0, 0);
|
ctx.drawImage(img, 0, 0);
|
||||||
|
|
||||||
// [r, g, b, a, r, g, b, a, ...]
|
// [r, g, b, a, r, g, b, a, ...]
|
||||||
|
|
После Ширина: | Высота: | Размер: 214 B |
После Ширина: | Высота: | Размер: 2.8 KiB |
После Ширина: | Высота: | Размер: 184 B |
После Ширина: | Высота: | Размер: 3.4 KiB |
После Ширина: | Высота: | Размер: 140 B |
После Ширина: | Высота: | Размер: 2.2 KiB |
После Ширина: | Высота: | Размер: 202 B |
После Ширина: | Высота: | Размер: 3.4 KiB |
|
@ -0,0 +1,22 @@
|
||||||
|
# PngSuite - Background colors
|
||||||
|
#
|
||||||
|
# Note 1: The first 4 images have no bKGD chunk, the last 4 do. The background
|
||||||
|
# color indicated by bKGD isn't used, so the two sets of images are rendered
|
||||||
|
# identically and thus share common reference HTML files.
|
||||||
|
|
||||||
|
# bgai4a08 - 8 bit grayscale, alpha, no background chunk, interlaced
|
||||||
|
fails-if(MOZ_WIDGET_TOOLKIT=="windows") == wrapper.html?bgai4a08.png bg__4a08.html
|
||||||
|
# bgai4a16 - 16 bit grayscale, alpha, no background chunk, interlaced
|
||||||
|
fails-if(MOZ_WIDGET_TOOLKIT=="windows") == wrapper.html?bgai4a16.png bg__4a16.html
|
||||||
|
# bgan6a08 - 3x8 bits rgb color, alpha, no background chunk
|
||||||
|
fails-if(MOZ_WIDGET_TOOLKIT=="windows") == wrapper.html?bgan6a08.png bg__6a08.html
|
||||||
|
# bgan6a16 - 3x16 bits rgb color, alpha, no background chunk
|
||||||
|
fails-if(MOZ_WIDGET_TOOLKIT=="windows") == wrapper.html?bgan6a16.png bg__6a16.html
|
||||||
|
# bgbn4a08 - 8 bit grayscale, alpha, black background chunk
|
||||||
|
fails-if(MOZ_WIDGET_TOOLKIT=="windows") == wrapper.html?bgbn4a08.png bg__4a08.html
|
||||||
|
# bggn4a16 - 16 bit grayscale, alpha, gray background chunk
|
||||||
|
fails-if(MOZ_WIDGET_TOOLKIT=="windows") == wrapper.html?bggn4a16.png bg__4a16.html
|
||||||
|
# bgwn6a08 - 3x8 bits rgb color, alpha, white background chunk
|
||||||
|
fails-if(MOZ_WIDGET_TOOLKIT=="windows") == wrapper.html?bgwn6a08.png bg__6a08.html
|
||||||
|
# bgyn6a16 - 3x16 bits rgb color, alpha, yellow background chunk
|
||||||
|
fails-if(MOZ_WIDGET_TOOLKIT=="windows") == wrapper.html?bgyn6a16.png bg__6a16.html
|
|
@ -0,0 +1,21 @@
|
||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Image reftest wrapper</title>
|
||||||
|
<style type="text/css">
|
||||||
|
#image1 { background-color: rgb(10, 100, 250); }
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<img id="image1">
|
||||||
|
<script>
|
||||||
|
// This loads a externally specified image with a background color
|
||||||
|
// set via CSS, to test transparency effects.
|
||||||
|
//
|
||||||
|
// Use as "wrapper.html?image.png"
|
||||||
|
//
|
||||||
|
var imgURL = document.location.search.substr(1);
|
||||||
|
document.images[0].src = imgURL;
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,10 @@
|
||||||
|
# PngSuite - Corrupted files
|
||||||
|
#
|
||||||
|
# Note: these are corrupt files, and so no image should be rendered.
|
||||||
|
|
||||||
|
# x00n0g01 - empty 0x0 grayscale file
|
||||||
|
== wrapper.html?x00n0g01.png about:blank
|
||||||
|
# xcrn0g04 - added cr bytes
|
||||||
|
== wrapper.html?xcrn0g04.png about:blank
|
||||||
|
# xlfn0g04 - added lf bytes
|
||||||
|
== wrapper.html?xlfn0g04.png about:blank
|
|
@ -0,0 +1,21 @@
|
||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Image reftest wrapper</title>
|
||||||
|
<style type="text/css">
|
||||||
|
#image1 { background-color: rgb(10, 100, 250); }
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<img id="image1">
|
||||||
|
<script>
|
||||||
|
// This loads a externally specified image with a background color
|
||||||
|
// set via CSS, to test transparency effects.
|
||||||
|
//
|
||||||
|
// Use as "wrapper.html?image.png"
|
||||||
|
//
|
||||||
|
var imgURL = document.location.search.substr(1);
|
||||||
|
document.images[0].src = imgURL;
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
После Ширина: | Высота: | Размер: 49 B |
|
@ -0,0 +1,13 @@
|
||||||
|
‰PNG
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
IHDR “בָ)ָIDATx<54>]ֱׁ
|
||||||
|
ֲ0P*@נ¡#°
|
||||||
|
|
||||||
|
#Tגָ10lPF`״ F=•<02>ִIQג*חֵuם”`%qk<71>
|
||||||
|
H<EFBFBD>ס<EFBFBD>ˆ©ס´€mקֽ<08>µא<C2B5><D790> ׁ<>=,¸fלOK
|
||||||
|
|
||||||
|
ח ׀t<D780>ְ(ָןה’׳¦םF;טP÷€¯¾{xpח]9‡/p<>*$(ל*יyלױƒ ׳<1E>יחט@קC¼ cװq<16>‹N<E280B9>U#„)11·.<2E><>rהנfה0°<30>הgh(¥<>t<1E>ֲEר<45>‰kIEND®B`‚
|
|
@ -0,0 +1,26 @@
|
||||||
|
# PngSuite - Transparency
|
||||||
|
|
||||||
|
# tbbn1g04 - transparent, black background chunk
|
||||||
|
fails-if(MOZ_WIDGET_TOOLKIT=="windows") == wrapper.html?tbbn1g04.png tbbn1g04.html
|
||||||
|
# tbbn2c16 - transparent, blue background chunk
|
||||||
|
fails-if(MOZ_WIDGET_TOOLKIT=="windows") == wrapper.html?tbbn2c16.png tbbn2c16.html
|
||||||
|
# tbbn3p08 - transparent, black background chunk
|
||||||
|
fails-if(MOZ_WIDGET_TOOLKIT=="windows") == wrapper.html?tbbn3p08.png tbbn3p08.html
|
||||||
|
# tbgn2c16 - transparent, green background chunk
|
||||||
|
fails-if(MOZ_WIDGET_TOOLKIT=="windows") == wrapper.html?tbgn2c16.png tbgn2c16.html
|
||||||
|
# tbgn3p08 - transparent, light-gray background chunk
|
||||||
|
fails-if(MOZ_WIDGET_TOOLKIT=="windows") == wrapper.html?tbgn3p08.png tbgn3p08.html
|
||||||
|
# tbrn2c08 - transparent, red background chunk
|
||||||
|
fails-if(MOZ_WIDGET_TOOLKIT=="windows") == wrapper.html?tbrn2c08.png tbrn2c08.html
|
||||||
|
# tbwn1g16 - transparent, white background chunk
|
||||||
|
fails-if(MOZ_WIDGET_TOOLKIT=="windows") == wrapper.html?tbwn1g16.png tbwn1g16.html
|
||||||
|
# tbwn3p08 - transparent, white background chunk
|
||||||
|
fails-if(MOZ_WIDGET_TOOLKIT=="windows") == wrapper.html?tbwn3p08.png tbwn3p08.html
|
||||||
|
# tbyn3p08 - transparent, yellow background chunk
|
||||||
|
fails-if(MOZ_WIDGET_TOOLKIT=="windows") == wrapper.html?tbyn3p08.png tbyn3p08.html
|
||||||
|
# tp0n1g08 - not transparent for reference (logo on gray)
|
||||||
|
# tp0n2c08 - not transparent for reference (logo on gray)
|
||||||
|
# tp0n3p08 - not transparent for reference (logo on gray)
|
||||||
|
# ...these 3 not tested because they're not transparent.
|
||||||
|
# tp1n3p08 - transparent, but no background chunk
|
||||||
|
fails-if(MOZ_WIDGET_TOOLKIT=="windows") == wrapper.html?tp1n3p08.png tp1n3p08.html
|
После Ширина: | Высота: | Размер: 419 B |
После Ширина: | Высота: | Размер: 1.9 KiB |
После Ширина: | Высота: | Размер: 1.1 KiB |
После Ширина: | Высота: | Размер: 1.9 KiB |
После Ширина: | Высота: | Размер: 1.1 KiB |
После Ширина: | Высота: | Размер: 1.3 KiB |
После Ширина: | Высота: | Размер: 1.1 KiB |
После Ширина: | Высота: | Размер: 1.1 KiB |
После Ширина: | Высота: | Размер: 1.1 KiB |
После Ширина: | Высота: | Размер: 1.1 KiB |
|
@ -0,0 +1,21 @@
|
||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Image reftest wrapper</title>
|
||||||
|
<style type="text/css">
|
||||||
|
#image1 { background-color: rgb(10, 100, 250); }
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<img id="image1">
|
||||||
|
<script>
|
||||||
|
// This loads a externally specified image with a background color
|
||||||
|
// set via CSS, to test transparency effects.
|
||||||
|
//
|
||||||
|
// Use as "wrapper.html?image.png"
|
||||||
|
//
|
||||||
|
var imgURL = document.location.search.substr(1);
|
||||||
|
document.images[0].src = imgURL;
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -9,12 +9,12 @@
|
||||||
include pngsuite-basic-n/reftest.list
|
include pngsuite-basic-n/reftest.list
|
||||||
include pngsuite-basic-i/reftest.list
|
include pngsuite-basic-i/reftest.list
|
||||||
include pngsuite-ancillary/reftest.list
|
include pngsuite-ancillary/reftest.list
|
||||||
#include pngsuite-background/reftest.list
|
include pngsuite-background/reftest.list
|
||||||
include pngsuite-chunkorder/reftest.list
|
include pngsuite-chunkorder/reftest.list
|
||||||
#include pngsuite-corrupted/reftest.list
|
include pngsuite-corrupted/reftest.list
|
||||||
include pngsuite-filtering/reftest.list
|
include pngsuite-filtering/reftest.list
|
||||||
include pngsuite-gamma/reftest.list
|
include pngsuite-gamma/reftest.list
|
||||||
include pngsuite-oddsizes/reftest.list
|
include pngsuite-oddsizes/reftest.list
|
||||||
include pngsuite-palettes/reftest.list
|
include pngsuite-palettes/reftest.list
|
||||||
#include pngsuite-transparency/reftest.list
|
include pngsuite-transparency/reftest.list
|
||||||
include pngsuite-zlib/reftest.list
|
include pngsuite-zlib/reftest.list
|
||||||
|
|