Resolution property for ImageLabels and ImageButtons

As a Roblox developer, it is currently too hard to determine an image’s resolution.

Knowing an image’s dimensions is extremely important,. Without knowing the resolution, you can’t determine the image’s aspect ratio or how much space it will take up; you are essentially blind on what the image actually is.

Without knowing these properties, you cannot:

  • Enforce a specific aspect ratio for images. (Useful for UGC)
  • Make the ImageLabel’s size match its actual content. (Useful for certain UI layouts)

Furthermore, since Roblox may decrease the image’s size after it’s uploaded, your source resolution could be different from what’s actually present in Roblox’s servers, making it an inaccurate measure for everything but the aspect ratio.

Currently, the only way to determine an image’s size in-game is to use an API proxy to check the image’s metadata, which is simply not an acceptable solution.

VideoFrames have a Resolution property, so why not ImageLabels and ImageButtons?

If this issue is addressed, it would improve my development experience because I wouldn’t require hardcoding or an API proxy just to know an image’s resolution (and its aspect ratio).

PS: Besides a property tied to an instance, I also believe we should have a direct way of determining an asset’s resolution with just its id, so we can initialize UI elements with the correct properties. Maybe through ContentProvider?