File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -224,6 +224,18 @@ The callback function is passed two arguments:
224
224
2 . An object with the original image dimensions as properties and potentially
225
225
additional [ metadata] ( #metadata-parsing ) .
226
226
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
+
227
239
#### Error handling
228
240
229
241
Example code implementing error handling:
@@ -236,8 +248,6 @@ loadImage(
236
248
console .error (' Error loading image file' )
237
249
} else {
238
250
document .body .appendChild (img)
239
- console .log (' Original image width: ' , data .originalWidth )
240
- console .log (' Original image height: ' , data .originalHeight )
241
251
}
242
252
},
243
253
{ maxWidth: 600 }
You can’t perform that action at this time.
0 commit comments