|
1 | 1 | /* |
2 | | - * JavaScript Load Image Test 1.1 |
| 2 | + * JavaScript Load Image Test 1.1.1 |
3 | 3 | * https://github.com/blueimp/JavaScript-Load-Image |
4 | 4 | * |
5 | 5 | * Copyright 2011, Sebastian Tschan |
|
88 | 88 | }, {minHeight: 240})); |
89 | 89 | }); |
90 | 90 |
|
| 91 | + $.asyncTest('Scale to options.minWidth but respect options.maxWidth', function () { |
| 92 | + $.ok($.loadImage(blob, function (img) { |
| 93 | + $.start(); |
| 94 | + $.strictEqual(img.width, 160); |
| 95 | + $.strictEqual(img.height, 120); |
| 96 | + }, {minWidth: 240, maxWidth: 160})); |
| 97 | + }); |
| 98 | + |
| 99 | + $.asyncTest('Scale to options.minHeight but respect options.maxHeight', function () { |
| 100 | + $.ok($.loadImage(blob, function (img) { |
| 101 | + $.start(); |
| 102 | + $.strictEqual(img.width, 160); |
| 103 | + $.strictEqual(img.height, 120); |
| 104 | + }, {minHeight: 180, maxHeight: 120})); |
| 105 | + }); |
| 106 | + |
| 107 | + $.asyncTest('Scale to options.minWidth but respect options.maxHeight', function () { |
| 108 | + $.ok($.loadImage(blob, function (img) { |
| 109 | + $.start(); |
| 110 | + $.strictEqual(img.width, 160); |
| 111 | + $.strictEqual(img.height, 120); |
| 112 | + }, {minWidth: 240, maxHeight: 120})); |
| 113 | + }); |
| 114 | + |
| 115 | + $.asyncTest('Scale to options.minHeight but respect options.maxWidth', function () { |
| 116 | + $.ok($.loadImage(blob, function (img) { |
| 117 | + $.start(); |
| 118 | + $.strictEqual(img.width, 160); |
| 119 | + $.strictEqual(img.height, 120); |
| 120 | + }, {minHeight: 180, maxWidth: 160})); |
| 121 | + }); |
| 122 | + |
91 | 123 | $.module('Canvas'); |
92 | 124 |
|
93 | 125 | $.asyncTest('Return img element to callback if options.canvas is not true', function () { |
|
0 commit comments