@@ -234,10 +234,17 @@ loadImage(
234
234
console .log (' Original image width: ' , data .originalWidth )
235
235
console .log (' Original image height: ' , data .originalHeight )
236
236
},
237
- { maxWidth: 600 }
237
+ { maxWidth: 600 , meta : true }
238
238
)
239
239
```
240
240
241
+ ** Please note:**
242
+ The original image dimensions reflect the natural width and height of the loaded
243
+ image before applying any transformation.
244
+ For consistent values across browsers, [ metadata] ( #metadata-parsing ) parsing has
245
+ to be enabled via ` meta:true ` , so ` loadImage ` can detect automatic image
246
+ orientation and normalize the dimensions.
247
+
241
248
#### Error handling
242
249
243
250
Example code implementing error handling:
@@ -264,7 +271,7 @@ argument and the
264
271
API is available, it returns a ` Promise ` object:
265
272
266
273
``` js
267
- loadImage (fileOrBlobOrUrl, { maxWidth: 600 })
274
+ loadImage (fileOrBlobOrUrl, { maxWidth: 600 , meta : true })
268
275
.then (function (data ) {
269
276
document .body .appendChild (data .image )
270
277
console .log (' Original image width: ' , data .originalWidth )
@@ -284,6 +291,9 @@ The `Promise` resolves with an object with the following properties:
284
291
- ` originalWidth ` : The original width of the image.
285
292
- ` originalHeight ` : The original height of the image.
286
293
294
+ Please also read the note about original image dimensions normalization in the
295
+ [ callback arguments] ( #callback-arguments ) section.
296
+
287
297
If [ metadata] ( #metadata-parsing ) has been parsed, additional properties might be
288
298
present on the object.
289
299
0 commit comments