MCPcopy Index your code
hub / github.com/blueimp/JavaScript-Load-Image / displayImage

Function displayImage

js/demo/demo.js:167–189  ·  view source on GitHub ↗

* Displays the image * * @param {File|Blob|string} file File or Blob object or image URL

(file)

Source from the content-addressed store, hash-verified

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

Callers 2

fileChangeHandlerFunction · 0.85
urlChangeHandlerFunction · 0.85

Calls 2

loadImageFunction · 0.85
removeMetaDataFunction · 0.85

Tested by

no test coverage detected