* Displays the image * * @param {File|Blob|string} file File or Blob object or image URL
(file)
| 165 | * @param {File|Blob|string} file File or Blob object or image URL |
| 166 | */ |
| 167 | function displayImage(file) { |
| 168 | var options = { |
| 169 | maxWidth: resultNode.width(), |
| 170 | canvas: true, |
| 171 | pixelRatio: window.devicePixelRatio, |
| 172 | downsamplingRatio: 0.5, |
| 173 | orientation: Number(orientationNode.val()) || true, |
| 174 | imageSmoothingEnabled: imageSmoothingNode.is(':checked'), |
| 175 | meta: true |
| 176 | } |
| 177 | if (!loadImage(file, updateResults, options)) { |
| 178 | removeMetaData() |
| 179 | resultNode |
| 180 | .children() |
| 181 | .replaceWith( |
| 182 | $( |
| 183 | '<span>' + |
| 184 | 'Your browser does not support the URL or FileReader API.' + |
| 185 | '</span>' |
| 186 | ) |
| 187 | ) |
| 188 | } |
| 189 | } |
| 190 | |
| 191 | /** |
| 192 | * Handles drop and file selection change events |
no test coverage detected