photo-editor
photo-editor copied to clipboard
Draws are "washed away" on certain photos.
I can't figure why, but if you draw on certain photos ( I just can't understand which is the criteria), the drawings become "wahsed away". The drawn lines fades away.
Is there a way to solve the problem?
I have the same issue on my phone. This effect appear under two conditions:
- If i'm using the FRONT facing camera (selfie camera).
- If I have NOT cropped the photo beforehand.
If I crop the photo first, and then draw over the photo, it is all OK. I have also noticed that if I apply different pressures to the screen, the washing effect changes i.e. if my finger is in the same position, but I vary the pressure, the ink on the photo moves.
Actually, after further investigation, it seems like this issue is only related to the aspect ratio of the image. It seems that very long images are ok with the ink, but very tall tall images make the ink wash away.
Thank you for the tips @NatanijelVasic ! I guess there's still no solution to this problem, right?
I have not yet found a solution, but I will continue to investigate. I also noticed that there is sometimes a horizontal cutoff in the image: above it, the ink behaves well, but below it, it gets washed away. Very strange!
Since the touch pressure affects the washing effect, I am starting to think that maybe this plugin uses some sort of iOS "brush" that intentionally washes away, instead of a normal "pencil".
Good point! I've tried several images with different aspect ratio. It keeps behave very randomly to me. The washing effect appears on square pics as well as on rectangular ones...
Can it be just a problem based on the pic resolution? After several tests, it seems to me that only pics with "lower" resolution are washed away (this is why pics took with the front camera have this issue).
I just tried loading the same image multiple times. Sometimes I get the bug, sometimes not.
It's just a shame this problem was never fixed after all these complains. And we're all going mad figuring out why...it just don't seem to have a logic.
Hi, @MehdiBrandoMahdloo. The solution had been found.
For this line of code: canvasImageView.image?.draw(in: CGRect(x: 0, y: 0, width: canvasImageView.frame.size.width, height: canvasImageView.frame.size.height))
It directly uses the image's width and height as the parameters. However, they may have decimal point.
I guess iOS automatically round down your value, and then the image is resized by 1 pixel per drawing action.
So, just adding ceiling function before using the size, the issue will be solved.
Good luck, and have a nice day! ^.^
Thank you so much HosaiPang! @NatanijelVasic did you try the solution suggested by @hosaipang ? Does it work?
@MehdiBrandoMahdloo Are you using the NativeScript plugin for this? Because the nativescript version does not download from this updated repository.
@hosaipang @MehdiBrandoMahdloo As far as I can see, someone fixed this bug 25 days ago in this repo, but in the Examples demo folder instead of the main source code folder. Was this a mistake?
@MehdiBrandoMahdloo Can you check the latest release 0.6 and update me please ?
@M-Hamed I also noticed the washing effect inside version 0.5 After updating to v0.6 I could not reproduce the issue again ;-)