meltingice / CamanJS

Javascript HTML5 (Ca)nvas (Man)ipulation
http://camanjs.com
BSD 3-Clause "New" or "Revised" License
3.55k stars 404 forks source link

Using crop() with preset filters that use copyParent produces artifacts in the image #153

Open raine opened 10 years ago

raine commented 10 years ago

This for example seems to have weird results for any effect that uses copyParent internally, until I comment the crop().

By the way, this is in node.

Caman(buf, function() {
  this.crop(290, 290, 25, 25);
  this[filter]();
  this.render(function() {
    resolve(this.canvas.toBuffer());
  });
});

update:

Here's a workaround:

Caman(buf, function() {
  this.crop(290, 290, 25, 25);
  this.render(function() {
    this[filter]();
    this.render(function() {
      resolve(this.canvas.toBuffer());
    });
  });
});
zaak commented 9 years ago

Have a look at my PR, it should solve this issue https://github.com/meltingice/CamanJS/pull/163