fix syntax
This commit is contained in:
@@ -31,13 +31,17 @@ var colorspaces = ["srgb", "srgb_linear", "jpeg", "bt601_limited", "bt709_limite
|
||||
var test_format = "rgba8888";
|
||||
|
||||
log.console("\nTest 3: Converting to", test_format, "with different colorspaces:");
|
||||
for (var i = 0; i < length(colorspaces); i++) {
|
||||
try {
|
||||
var conv = surf.convert(test_format, colorspaces[i]);
|
||||
var i = 0;
|
||||
var conv = null;
|
||||
var try_convert = null;
|
||||
for (i = 0; i < length(colorspaces); i++) {
|
||||
try_convert = function() {
|
||||
conv = surf.convert(test_format, colorspaces[i]);
|
||||
log.console(" " + colorspaces[i] + ": Success");
|
||||
} catch(e) {
|
||||
log.console(" " + colorspaces[i] + ": Failed -", e.message);
|
||||
} disruption {
|
||||
log.console(" " + colorspaces[i] + ": Failed");
|
||||
}
|
||||
try_convert();
|
||||
}
|
||||
|
||||
// Test 4: YUV formats with appropriate colorspaces
|
||||
@@ -49,15 +53,18 @@ var yuv_tests = [
|
||||
{format: "yvyu", colorspace: "bt601_full"}
|
||||
];
|
||||
|
||||
for (var i = 0; i < length(yuv_tests); i++) {
|
||||
var test = yuv_tests[i];
|
||||
try {
|
||||
var conv = surf.convert(test.format, test.colorspace);
|
||||
var test = null;
|
||||
var try_yuv = null;
|
||||
for (i = 0; i < length(yuv_tests); i++) {
|
||||
test = yuv_tests[i];
|
||||
try_yuv = function() {
|
||||
conv = surf.convert(test.format, test.colorspace);
|
||||
log.console(" " + test.format + " with " + test.colorspace + ": Success");
|
||||
} catch(e) {
|
||||
log.console(" " + test.format + " with " + test.colorspace + ": Failed -", e.message);
|
||||
} disruption {
|
||||
log.console(" " + test.format + " with " + test.colorspace + ": Failed");
|
||||
}
|
||||
try_yuv();
|
||||
}
|
||||
|
||||
log.console("\nColorspace conversion test complete!");
|
||||
$stop();
|
||||
$stop();
|
||||
|
||||
Reference in New Issue
Block a user