I’m having some trouble generating an ImageTexture. I’m getting an “Invalid image: image is empty” error.
Based on my testing, the issue appears to be at dyn_image.create_from_data(). I’m passing in a valid width, height, and PackedByteArray (I’m printing them to the terminal), but when I print the height and width of dyn_image, they’re both 0. I must be fundamentally misunderstanding something about how create_from_data works.
I thought it could be a format error but I verified the format enum of b.gradient.get_image() matched the one I was passing into create_from_data. I’m really not sure where else to go from here.
Thanks for the response! I figured out the issue, it was a silly mistake on my part. The resource I was referencing while writing some of this was for Godot 3. Between Godot 3 and Godot 4, create_from_data and create_from_image were changed to be static functions. Weirdly I didn’t get a warning or an error, but after fixing those, it worked as expected.