@@ -164,20 +164,20 @@ following two
164164#### Function signature
165165
166166The ` loadImage() ` function accepts a
167- [ File] ( https://developer.mozilla.org/en/DOM /File ) or
168- [ Blob] ( https://developer.mozilla.org/en/DOM/ Blob ) object or an image URL as
169- first argument.
167+ [ File] ( https://developer.mozilla.org/en-US/docs/Web/API /File ) or
168+ [ Blob] ( https://developer.mozilla.org/en-US/docs/Web/API/ Blob ) object or an image
169+ URL as first argument.
170170
171- If a [ File] ( https://developer.mozilla.org/en/DOM /File ) or
172- [ Blob] ( https://developer.mozilla.org/en/DOM/ Blob ) is passed as parameter, it
173- returns an HTML ` img ` element if the browser supports the
174- [ URL] ( https://developer.mozilla.org/en/DOM/window. URL ) API, alternatively a
175- [ FileReader] ( https://developer.mozilla.org/en/DOM/ FileReader ) object if the
176- ` FileReader ` API is supported, or ` false ` .
171+ If a [ File] ( https://developer.mozilla.org/en-US/docs/Web/API /File ) or
172+ [ Blob] ( https://developer.mozilla.org/en-US/docs/Web/API/ Blob ) is passed as
173+ parameter, it returns an HTML ` img ` element if the browser supports the
174+ [ URL] ( https://developer.mozilla.org/en-US/docs/Web/API/ URL ) API, alternatively a
175+ [ FileReader] ( https://developer.mozilla.org/en-US/docs/Web/API/ FileReader ) object
176+ if the ` FileReader ` API is supported, or ` false ` .
177177
178178It always returns an HTML
179- [ img] ( https://developer.mozilla.org/en/docs/HTML/Element/Img ) element when
180- passing an image URL:
179+ [ img] ( https://developer.mozilla.org/en-US /docs/Web/ HTML/Element/Img ) element
180+ when passing an image URL:
181181
182182``` js
183183var loadingImage = loadImage (
@@ -192,9 +192,9 @@ var loadingImage = loadImage(
192192#### Canceling event handling
193193
194194The ` img ` element or
195- [ FileReader] ( https://developer.mozilla.org/en/DOM/ FileReader ) object returned by
196- the ` loadImage() ` function allows to cancel event handling by setting the
197- ` onload ` and ` onerror ` event handlers to null:
195+ [ FileReader] ( https://developer.mozilla.org/en-US/docs/Web/API/ FileReader ) object
196+ returned by the ` loadImage() ` function allows to cancel event handling by
197+ setting the ` onload ` and ` onerror ` event handlers to null:
198198
199199``` js
200200var loadingImage = loadImage (
@@ -218,9 +218,11 @@ occurred while loading the image.
218218The callback function is passed two arguments:
219219
2202201 . An HTML [ img] ( https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img )
221- element or [ canvas] ( https://developer.mozilla.org/en/HTML/Canvas ) element, or
222- an [ Event] ( https://developer.mozilla.org/en/DOM/event ) object of type
223- ` error ` .
221+ element or
222+ [ canvas] ( https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API )
223+ element, or an
224+ [ Event] ( https://developer.mozilla.org/en-US/docs/Web/API/Event ) object of
225+ type ` error ` .
2242262 . An object with the original image dimensions as properties and potentially
225227 additional [ metadata] ( #metadata-parsing ) .
226228
@@ -278,15 +280,16 @@ The `Promise` resolves with an object with the following properties:
278280
279281- ` image ` : An HTML
280282 [ img] ( https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img ) or
281- [ canvas] ( https://developer.mozilla.org/en/HTML/Canvas ) element.
283+ [ canvas] ( https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API ) element.
282284- ` originalWidth ` : The original width of the image.
283285- ` originalHeight ` : The original height of the image.
284286
285287If [ metadata] ( #metadata-parsing ) has been parsed, additional properties might be
286288present on the object.
287289
288290If image loading fails, the ` Promise ` rejects with an
289- [ Event] ( https://developer.mozilla.org/en/DOM/event ) object of type ` error ` .
291+ [ Event] ( https://developer.mozilla.org/en-US/docs/Web/API/Event ) object of type
292+ ` error ` .
290293
291294## Options
292295
@@ -380,14 +383,14 @@ Defaults to `0` and requires `canvas: true`.
380383
381384Scales the image up/down to contain it in the max dimensions if set to ` true ` .
382385This emulates the CSS feature
383- [ background-image: contain] ( https://developer.mozilla.org/en-US/docs/Web/Guide/ CSS/Scaling_background_images #contain ) .
386+ [ background-image: contain] ( https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Backgrounds_and_Borders/Resizing_background_images #contain ) .
384387
385388### cover
386389
387390Scales the image up/down to cover the max dimensions with the image dimensions
388391if set to ` true ` .
389392This emulates the CSS feature
390- [ background-image: cover] ( https://developer.mozilla.org/en-US/docs/Web/Guide/ CSS/Scaling_background_images #cover ) .
393+ [ background-image: cover] ( https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Backgrounds_and_Borders/Resizing_background_images #cover ) .
391394
392395### aspectRatio
393396
@@ -487,24 +490,26 @@ callback function has additional properties (see
487490[ metadata parsing] ( #metadata-parsing ) ).
488491
489492If the file is given as URL and the browser supports the
490- [ fetch API] ( https://developer.mozilla.org/en/docs/Web/API/Fetch_API ) or the XHR
493+ [ fetch API] ( https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API ) or the
494+ XHR
491495[ responseType] ( https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/responseType )
492496` blob ` , fetches the file as ` Blob ` to be able to parse the metadata.
493497
494498### canvas
495499
496- Returns the image as [ canvas] ( https://developer.mozilla.org/en/HTML/Canvas )
497- element if set to ` true ` .
500+ Returns the image as
501+ [ canvas] ( https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API ) element if
502+ set to ` true ` .
498503
499504### crossOrigin
500505
501506Sets the ` crossOrigin ` property on the ` img ` element for loading
502- [ CORS enabled images] ( https://developer.mozilla.org/en-US/docs/HTML/CORS_Enabled_Image ) .
507+ [ CORS enabled images] ( https://developer.mozilla.org/en-US/docs/Web/ HTML/CORS_enabled_image ) .
503508
504509### noRevoke
505510
506511By default, the
507- [ created object URL] ( https://developer.mozilla.org/en/DOM/window. URL. createObjectURL )
512+ [ created object URL] ( https://developer.mozilla.org/en-US/docs/Web/API/ URL/ createObjectURL )
508513is revoked after the image has been loaded, except when this option is set to
509514` true ` .
510515
@@ -937,6 +942,6 @@ The JavaScript Load Image library is released under the
937942- Original image metadata handling implemented with the help and contribution of
938943 Achim Stöhr.
939944- Original Exif tags mapping based on Jacob Seidelin's
940- [ exif-js] ( https://github.com/jseidelin /exif-js ) library.
945+ [ exif-js] ( https://github.com/exif-js /exif-js ) library.
941946- Original IPTC parser implementation by
942947 [ Dave Bevan] ( https://github.com/bevand10 ) .
0 commit comments