Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bring callback toapplyfilters #3210

Merged
merged 16 commits into from
Aug 28, 2016
Merged

bring callback toapplyfilters #3210

merged 16 commits into from
Aug 28, 2016

Conversation

asturur
Copy link
Member

@asturur asturur commented Aug 26, 2016

to solve load from json issues and apply filters, both normal and dynamic resize.
Also take in consideration retina when scaling down the image so that crispness is preserved.
Added a parameter to do not scale over a factor of 0.5
closes #365

@neopheus
Copy link
Contributor

great :)

@@ -62,6 +62,9 @@
* @param {Number} scaleY
*/
applyTo: function(canvasEl, scaleX, scaleY) {
if (scaleX === 1 && scaleY === 1) {
return;
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make filter exit if we want have a bigger image than original.
The resize filter is meant for downscaling and too slow to be used as upscaler. There are no added details

@@ -296,7 +319,7 @@
* @return {String} Source of an image
*/
getSrc: function() {
var element = this.getElement();
var element = this._originalElement;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_element could be a replacement from filtering where src is no more meaningfull

@asturur asturur merged commit bba8b3a into master Aug 28, 2016
@asturur asturur deleted the callback-applyfilters branch September 10, 2016 13:18
@ats3v
Copy link

ats3v commented Sep 28, 2016

Hi there,

It seems like this commit changes something in a major way - the way we serialize and send the canvas as svg using toSVG method, when there are filters applied.
In the following scenario: you add an image and then you apply some filters on it, here is what happens

  1. previously it used to apply the filters on the image and send a new image as data (base 64)
  2. now it sends a URL to the original image

Is this the intended behavior? If yes, then how should one work with filters?

@asturur
Copy link
Member Author

asturur commented Sep 28, 2016

no, is not intended behaviour, i did not touch the export toSVG function but maybe the getSrc function changes are implied. Probably we do not have the test for it.

Please open an issue with the latest version, a small clear fiddle with the related code and i will fix it asap.

@ats3v
Copy link

ats3v commented Sep 30, 2016

Thanks a lot for your cooperation!
There is a link to the newly opened issue:
#3298

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Filters don't apply after load canvas from JSON
3 participants