mirror of
https://github.com/mosbth/cimage.git
synced 2025-08-04 23:27:43 +02:00
Restructured test-programs.
This commit is contained in:
8
webroot/test/config.php
Normal file
8
webroot/test/config.php
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<?php
|
||||||
|
// Use error reporting
|
||||||
|
error_reporting(-1);
|
||||||
|
ini_set('display_errors', 1);
|
||||||
|
|
||||||
|
|
||||||
|
// The link to img.php
|
||||||
|
$imgphp = "../img.php?src=";
|
101
webroot/test/template.php
Normal file
101
webroot/test/template.php
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<head>
|
||||||
|
<meta charset='utf-8'/>
|
||||||
|
<title><?=$title?></title>
|
||||||
|
<style>
|
||||||
|
body {background-color: #ccc;}
|
||||||
|
</style>
|
||||||
|
<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
window.getDetails = function (url, id) {
|
||||||
|
$.getJSON(url, function(data) {
|
||||||
|
element = document.getElementById(id);
|
||||||
|
element.innerHTML = "width: " + data.width + "\nheigh: " + data.height + "\naspect-ratio: " + data.aspectRatio;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1><?=$title?></h1>
|
||||||
|
|
||||||
|
<?php if (isset($description)) : ?>
|
||||||
|
<p><?=$description?></p>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<h2>Images used in test</h2>
|
||||||
|
|
||||||
|
<p>The following images are used for this test.</p>
|
||||||
|
|
||||||
|
<?php foreach($images as $image) : ?>
|
||||||
|
<p>
|
||||||
|
<code>
|
||||||
|
<a href="img/<?=$image?>"><?=$image?></a>
|
||||||
|
<a href="<?=$imgphp . $image . '&json'?>">(json)</a>
|
||||||
|
<a href="<?=$imgphp . $image . '&verbose'?>">(verbose)</a>
|
||||||
|
</code>
|
||||||
|
<br>
|
||||||
|
<img src="<?=$imgphp . $image?>"></p>
|
||||||
|
<p></p>
|
||||||
|
|
||||||
|
<pre id="<?=$image?>"></pre>
|
||||||
|
<script type="text/javascript">window.getDetails("<?=$imgphp . $image . '&json'?>", "<?=$image?>")</script>
|
||||||
|
|
||||||
|
<?php endforeach; ?>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<h2>Testcases used for each image</h2>
|
||||||
|
|
||||||
|
<p>The following testcases are used for each image.</p>
|
||||||
|
|
||||||
|
<?php foreach($testcase as $tc) : ?>
|
||||||
|
<code><?=$tc?></code><br>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<h2>For each image, apply all testcases</h2>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
$ch1 = 1;
|
||||||
|
foreach($images as $image) :
|
||||||
|
?>
|
||||||
|
<h3><?=$ch1?>. Using source image <?=$image?></h3>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<code>
|
||||||
|
<a href="img/<?=$image?>"><?=$image?></a>
|
||||||
|
<a href="<?=$imgphp . $image . '&json'?>">(json)</a>
|
||||||
|
<a href="<?=$imgphp . $image . '&verbose'?>">(verbose)</a>
|
||||||
|
</code>
|
||||||
|
<br>
|
||||||
|
<img src="<?=$imgphp . $image?>">
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<pre id="<?=$ch1?>"></pre>
|
||||||
|
<script type="text/javascript">window.getDetails("<?=$imgphp . $image . '&json'?>", "<?=$ch1?>")</script>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
$ch2 = 1;
|
||||||
|
foreach($testcase as $tc) :
|
||||||
|
$tcId = "$ch1.$ch2";
|
||||||
|
?>
|
||||||
|
<h4>Testcase <?=$tcId?>: <?=$tc?></h4>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<code>
|
||||||
|
<a href="<?=$imgphp . $image . $tc?>"><?=$image . $tc?></a>
|
||||||
|
<a href="<?=$imgphp . $image . $tc . '&json'?>">(json)</a>
|
||||||
|
<a href="<?=$imgphp . $image . $tc . '&verbose'?>">(verbose)</a>
|
||||||
|
</code>
|
||||||
|
<br>
|
||||||
|
<img src="<?=$imgphp . $image . $tc?>">
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<pre id="<?=$tcId?>"></pre>
|
||||||
|
<script type="text/javascript">window.getDetails("<?=$imgphp . $image . $tc . '&json'?>", "<?=$tcId?>")</script>
|
||||||
|
|
||||||
|
<?php $ch2++; endforeach; ?>
|
||||||
|
<?php $ch1++; endforeach; ?>
|
@@ -1,23 +1,20 @@
|
|||||||
<!doctype html>
|
|
||||||
<head>
|
|
||||||
<meta charset='utf-8'/>
|
|
||||||
<title>Testing img for issue 29</title>
|
|
||||||
<style>
|
|
||||||
body {background-color: #ccc;}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<h1>Testing issue 29</h1>
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
error_reporting(-1); // Report all type of errors
|
// Include config for all testcases
|
||||||
ini_set('display_errors', 1); // Display all errors
|
include __DIR__ . "/config.php";
|
||||||
ini_set('output_buffering', 0); // Do not buffer outputs, write directly
|
|
||||||
|
|
||||||
echo "<p>Version of PHP is: " . phpversion();
|
|
||||||
|
|
||||||
$imgphp = "../img.php?src=";
|
|
||||||
|
|
||||||
|
// The title of the test case
|
||||||
|
$title = "Testing img for issue 29";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Provide a short description of the testcase.
|
||||||
|
$description = "";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Use these images in the test
|
||||||
$images = array(
|
$images = array(
|
||||||
'issue29/400x265.jpg',
|
'issue29/400x265.jpg',
|
||||||
'issue29/400x268.jpg',
|
'issue29/400x268.jpg',
|
||||||
@@ -27,49 +24,15 @@ $images = array(
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// For each image, apply these testcases
|
||||||
$testcase = array(
|
$testcase = array(
|
||||||
'&w=300&cf&q=80&nc',
|
'&w=300&cf&q=80&nc',
|
||||||
'&w=75&h=75&cf&q=80&nc',
|
'&w=75&h=75&cf&q=80&nc',
|
||||||
'&w=75&h=75&q=80',
|
'&w=75&h=75&q=80',
|
||||||
);
|
);
|
||||||
?>
|
|
||||||
|
|
||||||
|
|
||||||
<h2>Images used in test</h2>
|
|
||||||
|
|
||||||
<p>The following images are used for this test.</p>
|
|
||||||
|
|
||||||
<?php foreach($images as $image) : ?>
|
|
||||||
<p><code><a href="img/<?=$image?>"><?=$image?></a></code><br>
|
|
||||||
<img src="<?=$imgphp . $image?>"></p>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h2>Testcases used for each image</h2>
|
// Applu testcases and present results
|
||||||
|
include __DIR__ . "/template.php";
|
||||||
<p>The following testcases are used for each image.</p>
|
|
||||||
|
|
||||||
<?php foreach($testcase as $tc) : ?>
|
|
||||||
<code><?=$tc?></code><br>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h2>Applying testcase for each image</h2>
|
|
||||||
|
|
||||||
<?php foreach($images as $image) : ?>
|
|
||||||
<h3><?=$image?></h3>
|
|
||||||
|
|
||||||
<p><code><a href="img/<?=$image?>"><?=$image?></a></code><br>
|
|
||||||
<img src="<?=$imgphp . $image?>"></p>
|
|
||||||
|
|
||||||
<?php foreach($testcase as $tc) : ?>
|
|
||||||
<h4><?=$tc?></h4>
|
|
||||||
|
|
||||||
<p><code><a href="<?=$imgphp . $image . $tc?>"><?=$image . $tc?></a></code><br>
|
|
||||||
<img src="<?=$imgphp . $image . $tc?>"></p>
|
|
||||||
|
|
||||||
<?php endforeach; ?>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
|
|
||||||
|
@@ -1,21 +1,20 @@
|
|||||||
<!doctype html>
|
|
||||||
<head>
|
|
||||||
<meta charset='utf-8'/>
|
|
||||||
<title>Testing img for issue 36 - autoRotate</title>
|
|
||||||
<style>
|
|
||||||
body {background-color: #ccc;}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<h1>Testing issue 36 - autoRotate</h1>
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
error_reporting(-1); // Report all type of errors
|
// Include config for all testcases
|
||||||
ini_set('display_errors', 1); // Display all errors
|
include __DIR__ . "/config.php";
|
||||||
ini_set('output_buffering', 0); // Do not buffer outputs, write directly
|
|
||||||
|
|
||||||
$imgphp = "../img.php?src=";
|
|
||||||
|
|
||||||
|
|
||||||
|
// The title of the test case
|
||||||
|
$title = "Testing issue 36 - autoRotate";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Provide a short description of the testcase.
|
||||||
|
$description = "";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Use these images in the test
|
||||||
$images = array(
|
$images = array(
|
||||||
'issue36/me-0.jpg',
|
'issue36/me-0.jpg',
|
||||||
'issue36/me-90.jpg',
|
'issue36/me-90.jpg',
|
||||||
@@ -28,50 +27,16 @@ $images = array(
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// For each image, apply these testcases
|
||||||
$testcase = array(
|
$testcase = array(
|
||||||
'&aro&nc',
|
'&aro&nc',
|
||||||
'&aro&nc&w=200',
|
'&aro&nc&w=200',
|
||||||
'&aro&nc&h=200',
|
'&aro&nc&h=200',
|
||||||
'&aro&nc&w=200&h=200&cf',
|
'&aro&nc&w=200&h=200&cf',
|
||||||
);
|
);
|
||||||
?>
|
|
||||||
|
|
||||||
|
|
||||||
<h2>Images used in test</h2>
|
|
||||||
|
|
||||||
<p>The following images are used for this test.</p>
|
|
||||||
|
|
||||||
<?php foreach($images as $image) : ?>
|
|
||||||
<p><code><a href="img/<?=$image?>"><?=$image?></a></code><br>
|
|
||||||
<img src="<?=$imgphp . $image?>"></p>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h2>Testcases used for each image</h2>
|
// Applu testcases and present results
|
||||||
|
include __DIR__ . "/template.php";
|
||||||
<p>The following testcases are used for each image.</p>
|
|
||||||
|
|
||||||
<?php foreach($testcase as $tc) : ?>
|
|
||||||
<code><?=$tc?></code><br>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h2>Applying testcase for each image</h2>
|
|
||||||
|
|
||||||
<?php foreach($images as $image) : ?>
|
|
||||||
<h3><?=$image?></h3>
|
|
||||||
|
|
||||||
<p><code><a href="img/<?=$image?>"><?=$image?></a></code><br>
|
|
||||||
<img src="<?=$imgphp . $image?>"></p>
|
|
||||||
|
|
||||||
<?php foreach($testcase as $tc) : ?>
|
|
||||||
<h4><?=$tc?></h4>
|
|
||||||
|
|
||||||
<p><code><a href="<?=$imgphp . $image . $tc?>"><?=$image . $tc?></a></code><br>
|
|
||||||
<img src="<?=$imgphp . $image . $tc?>"></p>
|
|
||||||
|
|
||||||
<?php endforeach; ?>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
|
|
||||||
|
@@ -1,28 +1,30 @@
|
|||||||
<?php
|
<?php
|
||||||
|
// Include config for all testcases
|
||||||
|
include __DIR__ . "/config.php";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// The title of the test case
|
||||||
$angle = 180;
|
$angle = 180;
|
||||||
?><!doctype html>
|
|
||||||
<head>
|
|
||||||
<meta charset='utf-8'/>
|
|
||||||
<title>Testing img for issue 36 - rotateBefore, rotateAfter <?=$angle?></title>
|
|
||||||
<style>
|
|
||||||
body {background-color: #ccc;}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<h1>Testing issue 36 - rotateBefore, rotateAfter <?=$angle?></h1>
|
|
||||||
|
|
||||||
<?php
|
$title = "Testing img for issue 36 - rotateBefore, rotateAfter <?=$angle?>";
|
||||||
error_reporting(-1); // Report all type of errors
|
|
||||||
ini_set('display_errors', 1); // Display all errors
|
|
||||||
ini_set('output_buffering', 0); // Do not buffer outputs, write directly
|
|
||||||
|
|
||||||
$imgphp = "../img.php?src=";
|
|
||||||
|
|
||||||
|
|
||||||
|
// Provide a short description of the testcase.
|
||||||
|
$description = "";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Use these images in the test
|
||||||
$images = array(
|
$images = array(
|
||||||
'kodim08.png',
|
'kodim08.png',
|
||||||
'kodim04.png',
|
'kodim04.png',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// For each image, apply these testcases
|
||||||
$testcase = array(
|
$testcase = array(
|
||||||
"&rb=$angle&nc",
|
"&rb=$angle&nc",
|
||||||
"&rb=$angle&nc&w=200",
|
"&rb=$angle&nc&w=200",
|
||||||
@@ -33,44 +35,8 @@ $testcase = array(
|
|||||||
"&ra=$angle&nc&h=200",
|
"&ra=$angle&nc&h=200",
|
||||||
"&ra=$angle&nc&w=200&h=200&cf",
|
"&ra=$angle&nc&w=200&h=200&cf",
|
||||||
);
|
);
|
||||||
?>
|
|
||||||
|
|
||||||
|
|
||||||
<h2>Images used in test</h2>
|
|
||||||
|
|
||||||
<p>The following images are used for this test.</p>
|
|
||||||
|
|
||||||
<?php foreach($images as $image) : ?>
|
|
||||||
<p><code><a href="img/<?=$image?>"><?=$image?></a></code><br>
|
|
||||||
<img src="<?=$imgphp . $image?>"></p>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h2>Testcases used for each image</h2>
|
// Apply testcases and present results
|
||||||
|
include __DIR__ . "/template.php";
|
||||||
<p>The following testcases are used for each image.</p>
|
|
||||||
|
|
||||||
<?php foreach($testcase as $tc) : ?>
|
|
||||||
<code><?=$tc?></code><br>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h2>Applying testcase for each image</h2>
|
|
||||||
|
|
||||||
<?php foreach($images as $image) : ?>
|
|
||||||
<h3><?=$image?></h3>
|
|
||||||
|
|
||||||
<p><code><a href="img/<?=$image?>"><?=$image?></a></code><br>
|
|
||||||
<img src="<?=$imgphp . $image?>"></p>
|
|
||||||
|
|
||||||
<?php foreach($testcase as $tc) : ?>
|
|
||||||
<h4><?=$tc?></h4>
|
|
||||||
|
|
||||||
<p><code><a href="<?=$imgphp . $image . $tc?>"><?=$image . $tc?></a></code><br>
|
|
||||||
<img src="<?=$imgphp . $image . $tc?>"></p>
|
|
||||||
|
|
||||||
<?php endforeach; ?>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
|
|
||||||
|
@@ -1,28 +1,30 @@
|
|||||||
<?php
|
<?php
|
||||||
|
// Include config for all testcases
|
||||||
|
include __DIR__ . "/config.php";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// The title of the test case
|
||||||
$angle = 270;
|
$angle = 270;
|
||||||
?><!doctype html>
|
|
||||||
<head>
|
|
||||||
<meta charset='utf-8'/>
|
|
||||||
<title>Testing img for issue 36 - rotateBefore, rotateAfter <?=$angle?></title>
|
|
||||||
<style>
|
|
||||||
body {background-color: #ccc;}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<h1>Testing issue 36 - rotateBefore, rotateAfter <?=$angle?></h1>
|
|
||||||
|
|
||||||
<?php
|
$title = "Testing img for issue 36 - rotateBefore, rotateAfter <?=$angle?>";
|
||||||
error_reporting(-1); // Report all type of errors
|
|
||||||
ini_set('display_errors', 1); // Display all errors
|
|
||||||
ini_set('output_buffering', 0); // Do not buffer outputs, write directly
|
|
||||||
|
|
||||||
$imgphp = "../img.php?src=";
|
|
||||||
|
|
||||||
|
|
||||||
|
// Provide a short description of the testcase.
|
||||||
|
$description = "";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Use these images in the test
|
||||||
$images = array(
|
$images = array(
|
||||||
'kodim08.png',
|
'kodim08.png',
|
||||||
'kodim04.png',
|
'kodim04.png',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// For each image, apply these testcases
|
||||||
$testcase = array(
|
$testcase = array(
|
||||||
"&rb=$angle&nc",
|
"&rb=$angle&nc",
|
||||||
"&rb=$angle&nc&w=200",
|
"&rb=$angle&nc&w=200",
|
||||||
@@ -33,44 +35,8 @@ $testcase = array(
|
|||||||
"&ra=$angle&nc&h=200",
|
"&ra=$angle&nc&h=200",
|
||||||
"&ra=$angle&nc&w=200&h=200&cf",
|
"&ra=$angle&nc&w=200&h=200&cf",
|
||||||
);
|
);
|
||||||
?>
|
|
||||||
|
|
||||||
|
|
||||||
<h2>Images used in test</h2>
|
|
||||||
|
|
||||||
<p>The following images are used for this test.</p>
|
|
||||||
|
|
||||||
<?php foreach($images as $image) : ?>
|
|
||||||
<p><code><a href="img/<?=$image?>"><?=$image?></a></code><br>
|
|
||||||
<img src="<?=$imgphp . $image?>"></p>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h2>Testcases used for each image</h2>
|
// Apply testcases and present results
|
||||||
|
include __DIR__ . "/template.php";
|
||||||
<p>The following testcases are used for each image.</p>
|
|
||||||
|
|
||||||
<?php foreach($testcase as $tc) : ?>
|
|
||||||
<code><?=$tc?></code><br>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h2>Applying testcase for each image</h2>
|
|
||||||
|
|
||||||
<?php foreach($images as $image) : ?>
|
|
||||||
<h3><?=$image?></h3>
|
|
||||||
|
|
||||||
<p><code><a href="img/<?=$image?>"><?=$image?></a></code><br>
|
|
||||||
<img src="<?=$imgphp . $image?>"></p>
|
|
||||||
|
|
||||||
<?php foreach($testcase as $tc) : ?>
|
|
||||||
<h4><?=$tc?></h4>
|
|
||||||
|
|
||||||
<p><code><a href="<?=$imgphp . $image . $tc?>"><?=$image . $tc?></a></code><br>
|
|
||||||
<img src="<?=$imgphp . $image . $tc?>"></p>
|
|
||||||
|
|
||||||
<?php endforeach; ?>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
|
|
||||||
|
@@ -1,78 +1,42 @@
|
|||||||
<?php
|
<?php
|
||||||
|
// Include config for all testcases
|
||||||
|
include __DIR__ . "/config.php";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// The title of the test case
|
||||||
$angle = 45;
|
$angle = 45;
|
||||||
?><!doctype html>
|
|
||||||
<head>
|
|
||||||
<meta charset='utf-8'/>
|
|
||||||
<title>Testing img for issue 36 - rotateBefore, rotateAfter <?=$angle?></title>
|
|
||||||
<style>
|
|
||||||
body {background-color: #ccc;}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<h1>Testing issue 36 - rotateBefore, rotateAfter <?=$angle?></h1>
|
|
||||||
|
|
||||||
<?php
|
$title = "Testing img for issue 36 - rotateBefore, rotateAfter <?=$angle?>";
|
||||||
error_reporting(-1); // Report all type of errors
|
|
||||||
ini_set('display_errors', 1); // Display all errors
|
|
||||||
ini_set('output_buffering', 0); // Do not buffer outputs, write directly
|
|
||||||
|
|
||||||
$imgphp = "../img.php?src=";
|
|
||||||
|
|
||||||
|
|
||||||
|
// Provide a short description of the testcase.
|
||||||
|
$description = "";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Use these images in the test
|
||||||
$images = array(
|
$images = array(
|
||||||
'kodim08.png',
|
'kodim08.png',
|
||||||
'kodim04.png',
|
'kodim04.png',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// For each image, apply these testcases
|
||||||
$testcase = array(
|
$testcase = array(
|
||||||
"&rb=$angle&bgc=ffffff&nc",
|
"&rb=$angle&nc",
|
||||||
"&rb=$angle&bgc=ffffff&nc&w=200",
|
"&rb=$angle&nc&w=200",
|
||||||
"&rb=$angle&bgc=ffffff&nc&h=200",
|
"&rb=$angle&nc&h=200",
|
||||||
"&rb=$angle&bgc=ffffff&nc&w=200&h=200&cf",
|
"&rb=$angle&nc&w=200&h=200&cf",
|
||||||
"&rb=$angle&bgc=ffffff&nc&w=200&h=200&cf&crop=200,200,center,center",
|
"&ra=$angle&nc",
|
||||||
"&ra=$angle&bgc=ffffff&nc",
|
"&ra=$angle&nc&w=200",
|
||||||
"&ra=$angle&bgc=ffffff&nc&w=200",
|
"&ra=$angle&nc&h=200",
|
||||||
"&ra=$angle&bgc=ffffff&nc&h=200",
|
"&ra=$angle&nc&w=200&h=200&cf",
|
||||||
"&ra=$angle&bgc=ffffff&nc&w=200&h=200&cf",
|
|
||||||
"&ra=$angle&bgc=ffffff&nc&w=200&h=200&cf&crop=200,200,center,center",
|
|
||||||
);
|
);
|
||||||
?>
|
|
||||||
|
|
||||||
|
|
||||||
<h2>Images used in test</h2>
|
|
||||||
|
|
||||||
<p>The following images are used for this test.</p>
|
|
||||||
|
|
||||||
<?php foreach($images as $image) : ?>
|
|
||||||
<p><code><a href="img/<?=$image?>"><?=$image?></a></code><br>
|
|
||||||
<img src="<?=$imgphp . $image?>"></p>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h2>Testcases used for each image</h2>
|
// Apply testcases and present results
|
||||||
|
include __DIR__ . "/template.php";
|
||||||
<p>The following testcases are used for each image.</p>
|
|
||||||
|
|
||||||
<?php foreach($testcase as $tc) : ?>
|
|
||||||
<code><?=$tc?></code><br>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h2>Applying testcase for each image</h2>
|
|
||||||
|
|
||||||
<?php foreach($images as $image) : ?>
|
|
||||||
<h3><?=$image?></h3>
|
|
||||||
|
|
||||||
<p><code><a href="img/<?=$image?>"><?=$image?></a></code><br>
|
|
||||||
<img src="<?=$imgphp . $image?>"></p>
|
|
||||||
|
|
||||||
<?php foreach($testcase as $tc) : ?>
|
|
||||||
<h4><?=$tc?></h4>
|
|
||||||
|
|
||||||
<p><code><a href="<?=$imgphp . $image . $tc?>"><?=$image . $tc?></a></code><br>
|
|
||||||
<img src="<?=$imgphp . $image . $tc?>"></p>
|
|
||||||
|
|
||||||
<?php endforeach; ?>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
|
|
||||||
|
@@ -1,28 +1,30 @@
|
|||||||
<?php
|
<?php
|
||||||
|
// Include config for all testcases
|
||||||
|
include __DIR__ . "/config.php";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// The title of the test case
|
||||||
$angle = 90;
|
$angle = 90;
|
||||||
?><!doctype html>
|
|
||||||
<head>
|
|
||||||
<meta charset='utf-8'/>
|
|
||||||
<title>Testing img for issue 36 - rotateBefore, rotateAfter <?=$angle?></title>
|
|
||||||
<style>
|
|
||||||
body {background-color: #ccc;}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<h1>Testing issue 36 - rotateBefore, rotateAfter <?=$angle?></h1>
|
|
||||||
|
|
||||||
<?php
|
$title = "Testing img for issue 36 - rotateBefore, rotateAfter <?=$angle?>";
|
||||||
error_reporting(-1); // Report all type of errors
|
|
||||||
ini_set('display_errors', 1); // Display all errors
|
|
||||||
ini_set('output_buffering', 0); // Do not buffer outputs, write directly
|
|
||||||
|
|
||||||
$imgphp = "../img.php?src=";
|
|
||||||
|
|
||||||
|
|
||||||
|
// Provide a short description of the testcase.
|
||||||
|
$description = "";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Use these images in the test
|
||||||
$images = array(
|
$images = array(
|
||||||
'kodim08.png',
|
'kodim08.png',
|
||||||
'kodim04.png',
|
'kodim04.png',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// For each image, apply these testcases
|
||||||
$testcase = array(
|
$testcase = array(
|
||||||
"&rb=$angle&nc",
|
"&rb=$angle&nc",
|
||||||
"&rb=$angle&nc&w=200",
|
"&rb=$angle&nc&w=200",
|
||||||
@@ -33,44 +35,8 @@ $testcase = array(
|
|||||||
"&ra=$angle&nc&h=200",
|
"&ra=$angle&nc&h=200",
|
||||||
"&ra=$angle&nc&w=200&h=200&cf",
|
"&ra=$angle&nc&w=200&h=200&cf",
|
||||||
);
|
);
|
||||||
?>
|
|
||||||
|
|
||||||
|
|
||||||
<h2>Images used in test</h2>
|
|
||||||
|
|
||||||
<p>The following images are used for this test.</p>
|
|
||||||
|
|
||||||
<?php foreach($images as $image) : ?>
|
|
||||||
<p><code><a href="img/<?=$image?>"><?=$image?></a></code><br>
|
|
||||||
<img src="<?=$imgphp . $image?>"></p>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h2>Testcases used for each image</h2>
|
// Applu testcases and present results
|
||||||
|
include __DIR__ . "/template.php";
|
||||||
<p>The following testcases are used for each image.</p>
|
|
||||||
|
|
||||||
<?php foreach($testcase as $tc) : ?>
|
|
||||||
<code><?=$tc?></code><br>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h2>Applying testcase for each image</h2>
|
|
||||||
|
|
||||||
<?php foreach($images as $image) : ?>
|
|
||||||
<h3><?=$image?></h3>
|
|
||||||
|
|
||||||
<p><code><a href="img/<?=$image?>"><?=$image?></a></code><br>
|
|
||||||
<img src="<?=$imgphp . $image?>"></p>
|
|
||||||
|
|
||||||
<?php foreach($testcase as $tc) : ?>
|
|
||||||
<h4><?=$tc?></h4>
|
|
||||||
|
|
||||||
<p><code><a href="<?=$imgphp . $image . $tc?>"><?=$image . $tc?></a></code><br>
|
|
||||||
<img src="<?=$imgphp . $image . $tc?>"></p>
|
|
||||||
|
|
||||||
<?php endforeach; ?>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
|
|
||||||
|
@@ -1,36 +1,27 @@
|
|||||||
<!doctype html>
|
|
||||||
<head>
|
|
||||||
<meta charset='utf-8'/>
|
|
||||||
<title>Testing img for issue 40 - no ratio</title>
|
|
||||||
<style>
|
|
||||||
body {background-color: #ccc;}
|
|
||||||
</style>
|
|
||||||
<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
window.getDetails = function (url, id) {
|
|
||||||
$.getJSON(url, function(data) {
|
|
||||||
element = document.getElementById(id);
|
|
||||||
element.innerHTML = "width: " + data.width + "\nheigh: " + data.height + "\naspect-ratio: " + data.aspectRatio;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<h1>Testing issue 40 - no ratio</h1>
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
error_reporting(-1); // Report all type of errors
|
// Include config for all testcases
|
||||||
ini_set('display_errors', 1); // Display all errors
|
include __DIR__ . "/config.php";
|
||||||
|
|
||||||
$imgphp = "../img.php?src=";
|
|
||||||
|
|
||||||
|
|
||||||
|
// The title of the test case
|
||||||
|
$title = "Testing issue 40 - no ratio";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Provide a short description of the testcase.
|
||||||
|
$description = "Showing off how to resize image with and without ratio.";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Use these images in the test
|
||||||
$images = array(
|
$images = array(
|
||||||
'issue40/source.jpg',
|
'issue40/source.jpg',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// For each image, apply these testcases
|
||||||
$testcase = array(
|
$testcase = array(
|
||||||
'&nc&width=652&height=466',
|
'&nc&width=652&height=466',
|
||||||
'&nc&width=652&height=466&no-ratio',
|
'&nc&width=652&height=466&no-ratio',
|
||||||
@@ -39,82 +30,8 @@ $testcase = array(
|
|||||||
'&nc&width=652&aspect-ratio=1.4&no-ratio',
|
'&nc&width=652&aspect-ratio=1.4&no-ratio',
|
||||||
'&nc&width=652&aspect-ratio=1.4&crop-to-fit',
|
'&nc&width=652&aspect-ratio=1.4&crop-to-fit',
|
||||||
);
|
);
|
||||||
?>
|
|
||||||
|
|
||||||
|
|
||||||
<h2>Images used in test</h2>
|
|
||||||
|
|
||||||
<p>The following images are used for this test.</p>
|
|
||||||
|
|
||||||
<?php foreach($images as $image) : ?>
|
|
||||||
<p>
|
|
||||||
<code>
|
|
||||||
<a href="img/<?=$image?>"><?=$image?></a>
|
|
||||||
<a href="<?=$imgphp . $image . '&json'?>">(json)</a>
|
|
||||||
<a href="<?=$imgphp . $image . '&verbose'?>">(verbose)</a>
|
|
||||||
</code>
|
|
||||||
<br>
|
|
||||||
<img src="<?=$imgphp . $image?>"></p>
|
|
||||||
<p></p>
|
|
||||||
|
|
||||||
<pre id="<?=$image?>"></pre>
|
|
||||||
<script type="text/javascript">window.getDetails("<?=$imgphp . $image . '&json'?>", "<?=$image?>")</script>
|
|
||||||
|
|
||||||
<?php endforeach; ?>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h2>Testcases used for each image</h2>
|
// Apply testcases and present results
|
||||||
|
include __DIR__ . "/template.php";
|
||||||
<p>The following testcases are used for each image.</p>
|
|
||||||
|
|
||||||
<?php foreach($testcase as $tc) : ?>
|
|
||||||
<code><?=$tc?></code><br>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h2>Applying testcase for each image</h2>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
$ch1 = 1;
|
|
||||||
foreach($images as $image) :
|
|
||||||
?>
|
|
||||||
<h3><?=$ch1?>. Using source image <?=$image?></h3>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
<code>
|
|
||||||
<a href="img/<?=$image?>"><?=$image?></a>
|
|
||||||
<a href="<?=$imgphp . $image . '&json'?>">(json)</a>
|
|
||||||
<a href="<?=$imgphp . $image . '&verbose'?>">(verbose)</a>
|
|
||||||
</code>
|
|
||||||
<br>
|
|
||||||
<img src="<?=$imgphp . $image?>">
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<pre id="<?=$ch1?>"></pre>
|
|
||||||
<script type="text/javascript">window.getDetails("<?=$imgphp . $image . '&json'?>", "<?=$ch1?>")</script>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
$ch2 = 1;
|
|
||||||
foreach($testcase as $tc) :
|
|
||||||
$tcId = "$ch1.$ch2";
|
|
||||||
?>
|
|
||||||
<h4>Testcase <?=$tcId?>: <?=$tc?></h4>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
<code>
|
|
||||||
<a href="<?=$imgphp . $image . $tc?>"><?=$image . $tc?></a>
|
|
||||||
<a href="<?=$imgphp . $image . $tc . '&json'?>">(json)</a>
|
|
||||||
<a href="<?=$imgphp . $image . $tc . '&verbose'?>">(verbose)</a>
|
|
||||||
</code>
|
|
||||||
<br>
|
|
||||||
<img src="<?=$imgphp . $image . $tc?>">
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<pre id="<?=$tcId?>"></pre>
|
|
||||||
<script type="text/javascript">window.getDetails("<?=$imgphp . $image . $tc . '&json'?>", "<?=$tcId?>")</script>
|
|
||||||
|
|
||||||
<?php $ch2++; endforeach; ?>
|
|
||||||
<?php $ch1++; endforeach; ?>
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user