From c42d2c20d68b97de381181476c059e6076bc4ecc Mon Sep 17 00:00:00 2001 From: Ira Pochaievets Date: Thu, 30 Oct 2025 17:44:32 +0200 Subject: [PATCH] fix(android): coerce string width/height in ImageAssetOptions #6289 --- packages/core/image-asset/index.android.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/core/image-asset/index.android.ts b/packages/core/image-asset/index.android.ts index 4bba7d1506..ee4119c52f 100644 --- a/packages/core/image-asset/index.android.ts +++ b/packages/core/image-asset/index.android.ts @@ -26,6 +26,16 @@ export class ImageAsset extends ImageAssetBase { } public getImageAsync(callback: (image, error) => void) { + // Fix for issue #6289: ensure numeric width/height + if (this.options) { + if (typeof this.options.width === "string") { + this.options.width = parseInt(this.options.width, 10); + } + if (typeof this.options.height === "string") { + this.options.height = parseInt(this.options.height, 10); + } + } + org.nativescript.widgets.Utils.loadImageAsync( getNativeApp().getApplicationContext(), this.android, @@ -42,4 +52,5 @@ export class ImageAsset extends ImageAssetBase { }), ); } + }