1
0
mirror of https://github.com/mosbth/cimage.git synced 2025-08-29 10:29:47 +02:00

updating strategies to use for no-upscale

This commit is contained in:
Mikael Roos
2014-12-15 17:14:06 +01:00
parent 90bfced741
commit 1144c8e105
3 changed files with 84 additions and 17 deletions

View File

@@ -550,9 +550,21 @@ if ($verbose) {
unset($query['nc']);
unset($query['json']);
$url1 = '?' . htmlentities(urldecode(http_build_query($query)));
$url2 = '?' . urldecode(http_build_query($query));
echo <<<EOD
<a href=$url1><code>$url1</code></a><br>
<img src='{$url1}' />
<pre id="json"></pre>
<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 = "filename: " + data.filename + "\\ncolors: " + data.colors + "\\nsize: " + data.size + "\\nwidth: " + data.width + "\\nheigh: " + data.height + "\\naspect-ratio: " + data.aspectRatio;
});
}
</script>
<script type="text/javascript">window.getDetails("{$url2}&json", "json")</script>
EOD;
}

View File

@@ -22,7 +22,7 @@ $images = array(
// For each image, apply these testcases
$nc = null; //"&nc"; //null; //&nc';
$nc = "&nc"; //null; //&nc';
$testcase = array(
$nc . '&w=600',
$nc . '&w=600&no-upscale',
@@ -30,10 +30,18 @@ $testcase = array(
$nc . '&h=400&no-upscale',
$nc . '&w=600&h=400',
$nc . '&w=600&h=400&no-upscale',
$nc . '&w=600&h=400&stretch',
$nc . '&w=600&h=400&no-upscale&stretch',
$nc . '&w=700&h=400&stretch',
$nc . '&w=700&h=400&no-upscale&stretch',
$nc . '&w=700&h=200&stretch',
$nc . '&w=700&h=200&no-upscale&stretch',
$nc . '&w=300&h=400&stretch',
$nc . '&w=300&h=400&no-upscale&stretch',
$nc . '&w=600&h=400&crop-to-fit',
$nc . '&w=600&h=400&no-upscale&crop-to-fit',
$nc . '&w=600&h=200&crop-to-fit',
$nc . '&w=600&h=200&no-upscale&crop-to-fit',
$nc . '&w=300&h=400&crop-to-fit',
$nc . '&w=300&h=400&no-upscale&crop-to-fit',
$nc . '&w=600&h=400&fill-to-fit',
$nc . '&w=600&h=400&no-upscale&fill-to-fit',
/*