I want to draw an image to canvas within a Cordova app.
When the image path is within the www
directory of my app, the drawing works as expected.
However, if the image is made by the Cordova camera and is thus stored in ../../tmp
in relation to the www
directory, the drawImage(...)
produces a black picture.
This might be a security issue, since the app's source code is found in the www
directory, but the images are not. On the other hand, an <img>
tag can show these images without a problem.
Is the problem really a security issue? And what can I do to solve it, i.e. to not produce a black picture?
After trying out an endless amount of things:
The problem was simply that the image which I wanted to use with drawImage()
was too high res. Lowering the resolution made the problem disappear: the canvas is not black anymore... (so not a security issue)