godotengine / godotengine/godot
`RGFloat` Texture with small height gives `Image height must be greater than 0.` error
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
### Tested versions
Reproducible in 3.5.stable
### System information
Windows 10 - Godot 3.5.stable
### Issue description
The engine is giving an error (`ERROR: Image height must be greater than 0.
at: (core/image.cpp:933)` ) that the `RGFloat` Texture I'm using has an invalid height, when in fact it has a completely valid, albeit small, height.
I've had this issue show up with the resolutions `2048x1` `2048x2` `2048x4`. I presume that it is related to https://github.com/godotengine/godot/issues/36940, and the issues persist to up to 16 pixels in height. I have not had this issue with other Texture types.
Any Texture that gives this error will still work normally. In this case, the image used is the Godot `icon.png` turned into a `RGFloat` Texture by making it an emission mask for a `Particle2D`, using the `solid pixels` option. My hypothesis is that it's the preview image in the editor that is actually giving this error.

### Steps to reproduce
1. Add a `Particle2D` node to a scene.
2. Add a `ParticleMaterial` to the node.
3. Select the Particle2D node and click `Particles` in the top bar of the Engine
4. Select `Load Emission Mask`
5. Navigate to the `icon.png` and select it.
6. Use `solid pixels` - this will give a 2048x2px Texture
7. Open the `ParticleMaterial` and open the `Emission Shape` dropdown.
8. An Error reading `ERROR: Image height must be greater than 0.
at: (core/image.cpp:933)` will appear in the Console.
### Minimal reproduction project (MRP)
Shouldn't be necessary, but just in case!
[RGFloatImageHeight.zip](https://github.com/godotengine/godot/files/15112356/RGFloatImageHeight.zip)
Contributor guide
Research direction
Reproduce the error using the provided RGFloatImageHeight.zip project and the Particle2D steps. Start at core/image.cpp:933, then trace the RGFloat emission-mask preview path used by ParticleMaterial. Done means valid small heights such as 2048x1, 2048x2, and 2048x4 no longer produce the reported error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- computer-graphics, game-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100