We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi all, I'm trying to access the pixel data of an Image that I'm uploading on the client-side using the drop() method.
Using createImg() creates a p5.dom img object, as opposed to a p5.image, so I attempted to use loadImage(file.data) where file.data is the src as opposed to a string pointing to a local file. This returns a p5.image object, however the pixels array returns as
pixels: Uint8ClampedArray instead of 'pixels:Array' when the same image is loaded in setup using
var img = loadImage("test.jpg");, though my assumption is that there's no real difference between the two as it's just returning information about the buffer being used.
The interesting thing is that console logging the width and height of the image loaded in setup reads 1920 x 1080, whereas the width and height of the image loaded using drop() reads as 1 x 1, despite showing up in the debugger as having the same properties..