File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -224,6 +224,18 @@ The callback function is passed two arguments:
2242242 . An object with the original image dimensions as properties and potentially
225225 additional [ metadata] ( #metadata-parsing ) .
226226
227+ ``` js
228+ loadImage (
229+ fileOrBlobOrUrl,
230+ function (img , data ) {
231+ document .body .appendChild (img)
232+ console .log (' Original image width: ' , data .originalWidth )
233+ console .log (' Original image height: ' , data .originalHeight )
234+ },
235+ { maxWidth: 600 }
236+ )
237+ ```
238+
227239#### Error handling
228240
229241Example code implementing error handling:
@@ -236,8 +248,6 @@ loadImage(
236248 console .error (' Error loading image file' )
237249 } else {
238250 document .body .appendChild (img)
239- console .log (' Original image width: ' , data .originalWidth )
240- console .log (' Original image height: ' , data .originalHeight )
241251 }
242252 },
243253 { maxWidth: 600 }
You can’t perform that action at this time.
0 commit comments