You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Angular 7 -> 8 update
I just updated my project to Angular 8, but the update procedure complained about angular-cropperjs not being compatible.
# ng update @angular/cli @angular/core
Package "angular-cropperjs" has an incompatible peer dependency to "@angular/core" (requires "^6.0.0-rc.0 || ^6.0.0" (extended), would install "8.2.14").
Then I realized that I've successfully been using this package with Angular 7. So I went along and added --force to the update command, and everything worked out just fine.
Using imageSmoothingQuality
The following is probably not related to Angular 8: I needed to add imageSmoothingQuality as an option for getCroppedCanvas. According to the Cropper JS docs, this option takes a string value of either "low", "medium" or "high".
But I got this error:
Type '"low"' is not assignable to type 'ImageSmoothingQuality'
In the file index.d.ts(15) there is a type defined for this value:
enum ImageSmoothingQuality {
Low = 'low',
Medium = 'medium',
High = 'high',
}
.. which is used in the interface at index.d.ts(65):
No matter how I tried, I could not make it work. So I ended up changing the type to "string" in the above interface:
imageSmoothingQuality?: string;
And now it works like a charm... I wonder why this custom type is necessary when the underlying cropper just expects a string?
Thank you...
... for this fantastic package. I can't encourage you enough to update the compatible versions and maybe fix it a bit here and there. I think it still has a few years in it :-)
The text was updated successfully, but these errors were encountered:
Hi there,
i'm planning to do a good refactor in this lib and add some new other cool features, didn't had much time lately but i will do it very soon in the next weeks. It will be available for angular 8 and upcoming 9, hold on for a bit, i will include that fix in the new version.
Angular 7 -> 8 update
I just updated my project to Angular 8, but the update procedure complained about angular-cropperjs not being compatible.
# ng update @angular/cli @angular/core
Package "angular-cropperjs" has an incompatible peer dependency to "@angular/core" (requires "^6.0.0-rc.0 || ^6.0.0" (extended), would install "8.2.14").
Then I realized that I've successfully been using this package with Angular 7. So I went along and added
--force
to the update command, and everything worked out just fine.Using imageSmoothingQuality
The following is probably not related to Angular 8: I needed to add imageSmoothingQuality as an option for getCroppedCanvas. According to the Cropper JS docs, this option takes a string value of either "low", "medium" or "high".
But I got this error:
Type '"low"' is not assignable to type 'ImageSmoothingQuality'
In the file index.d.ts(15) there is a type defined for this value:
.. which is used in the interface at index.d.ts(65):
No matter how I tried, I could not make it work. So I ended up changing the type to "string" in the above interface:
imageSmoothingQuality?: string;
And now it works like a charm... I wonder why this custom type is necessary when the underlying cropper just expects a string?
Thank you...
... for this fantastic package. I can't encourage you enough to update the compatible versions and maybe fix it a bit here and there. I think it still has a few years in it :-)
The text was updated successfully, but these errors were encountered: