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

doesn't work when image replaced #26

Open
serge22 opened this issue Sep 15, 2013 · 1 comment
Open

doesn't work when image replaced #26

serge22 opened this issue Sep 15, 2013 · 1 comment

Comments

@serge22
Copy link

serge22 commented Sep 15, 2013

Hello,
I am building client-side image editor with Pixastic as backend. Pixastic transforms IMG element to CANVAS for image manipulations. I cannot use Jrac "resize" functionality once IMG element has been replaced. Is there any way I can update (refresh) element inside Jrac object?

@trepmag
Copy link
Owner

trepmag commented Sep 16, 2013

Pixastic use the html5 canvas object and it is what is returned by its process() method, eg:

canvas = Pixastic.process(img, "desaturate");

Then, you can use the toData() method of the canvas object to return the corresponding data URL value and use it as a source image tag. Which could give somehting like the following for jrac:

$viewport.find('img').attr('src', canvas.toData()); 
// where $viewport is a div that can be selected with the 'jrac_viewport' class.

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

No branches or pull requests

2 participants