Automatically adjusting an imagelabel's height based off of it's image

I have a list of items which is split half and half, one half is text and the other is an image label

I want to be able to automatically set the image label’s size according to it’s contained image, rather than fitting the image to a set height

For example, on this screenshot, the image is too large because it has empty spaces around it, which get worse if the screen size changes (hence why i want to keep the imagelabel to fit it’s image height)

I want to instead adjust the image to only take up the space it needs to render the image vertically (always keeping the half and half of text and image)

I’ve tried setting the image’s AutomaticSizeY and adding an UIFlexItem to the image but neither work

You can use editable images to get the size of your images in pixels, which I assume is what you want to do.

local AssetService = game:GetService("AssetService");

local function GetImageSize(AssetId: number): Vector2?
        local Success, Image = pcall(AssetService.CreateEditableImageAsync, AssetService, Content.fromAssetId(AssetId));
        return Image.Size
end

print(GetImageSize(YOUR ID HERE));

Do note that it can fail, and if it does, the function will return nil, so make sure to check that before attempting to use the returned value. Also note that to use the editable images api in live experiences, you need to be ID verified.

There is like ScaleType (which is a Enum) in imagelabel or imagebutton

Try that see any mode and use it to find and get what results you want