Closed DinerIsmail closed 4 years ago
Hi @DinerIsmail,
the main API of this library has never changed, so it's safe to upgrade for the large majority of use cases.
The breaking changes are around EXIF handling and expectations of behavior with auto-oriented images, specifically:
orientation:true
, all operations were done on the image as provided by the browser, so e.g. cropping options were inconsistent between browsers (those with auto-orientation support and those without). So this is only a breaking change if you were relying on that inconsistent behavior.While I don't keep a manual changelog, I generally try to write useful commit messages, so the commit history is the closest thing to a formal changelog.
That being said, I acknowledge that a changelog is beneficial and given that this is the third changelog related issue ticket (see #91 and #99), I might still introduce one at some point for efficiency reasons.
I'm also aware that instead of writing this reply here I could also have added a proper changelog. 😬
is there a chance canvas option set to true by default changed after v2? i seem to be needing to pass canvas: true to have it worked as before.
Hi @oorestisime,
the library itself never changed its API nor any of the default options, with the exception of Exif tags mapping. All other breaking changes come from a change in browser behavior, since browser vendors decided to make the breaking change of auto-orienting images based on Exif data.
Unless you set canvas: true
manually, the library only returns a canvas object if necessary.
I assume you're using the orientation: true
option, which did change behavior due to a difference in browser behavior. The following is from the updated orientation documentation:
Setting orientation to true enables the canvas and meta options, unless the browser supports automatic image orientation
The relevant function that determines this behavior is this one: https://github.com/blueimp/JavaScript-Load-Image/blob/cb5e5d0736101894d22ab1094f2fede402a89be0/js/load-image-orientation.js#L182-L188
So yeah, before the browser updates to auto-orient images, images with auto-orientation always required canvas, now most browsers do that by default and a normal image element can be returned.
Oh right ok many thanks for the clarification. I was relying on it being a canvas without knowing it wasn't the default!
This package seems to have updated 3 major versions in 3 weeks. I'd like to update but I don't see a changelog anywhere. Could anyone please point me to one?
Otherwise, at least breaking changes are worth mentioning.