Open ShreenivasCh opened 11 years ago
how are you trying to use the effects on the android mobile phone?
if I use existing canvas of an image like this: Caman(clone[0], function () { //clone is jquery of the canvas in the DOM this.render(); }); it will show a blank image on android emulator but it will works good on desktop browser (Chrome). I did a little bit of debug to Caman and I found in the function "Caman.prototype.hiDPIAdjustments" the ratio is 1 in chrome and 2 in android, this is because "window.devicePixelRatio" return 2 in android instead of 1. therefore, it makes the canvas to show a blank image.
hope It will help you.
Additional things: after removing this piece of code for caman: if (ratio !== 1) { Log.debug("HiDPI ratio = " + ratio); this.scaled = true; this.originalWidth = this.canvas.width; this.originalHeight = this.canvas.height; this.canvas.width = this.originalWidth * ratio; this.canvas.height = this.originalHeight * ratio; this.canvas.style.width = "" + this.originalWidth + "px"; this.canvas.style.height = "" + this.originalHeight + "px"; this.context.scale(ratio, ratio); this.width = this.canvas.width; return this.height = this.canvas.height; }
This is the code that makes the problem and it will get into the if statement if ratio is not 1 (the same value to talk about above). if I remove this piece of code it works good, but it not the way to solve the problem and I can not fix the bug because I don't really understand way this statement here from the first place.
good point noampz! i solved my android problems by adding simply "data-caman-hidpi-disabled" to my canvas like stated in http://camanjs.com/guides/#BasicUsage. works like a charm now ;)
I have this same problem on both Android and iPhones, and I'd rather not disable hidpi display if the device supports it (which I believe iPhones are supposed to). Is there a solution for the iPhone that will allow me to still use HiDPI/Retina?
CamanJs effects are not working on android mobile... why????????