Currently, I am Working on image editor that allows me to crop an image and apply a filter. I am using fabric js version 1.7.22. I want to implement crop functionality. so my cropping flow is like Below :
- crop image using a plugin and ger base64 of the cropped image.
- generate blobUrl from base64 which help to display image in fabric js canvas.
- After Cropping the image, I Just replace old image src with new One.
It works fine when an image has no filter.
but when I try to set a filter in the image first then try to replace src using setSrc() function.
It throws an error like Below
filter.applyTo is not a function
I have created one fiddle for demonstrating to replace src after the apply filter. https://jsfiddle.net/Mark_1998/98gLhcb4/1/
And I Can't upgrade my fabric js version. If any patch Available then
Please Help Me.