From eb550459b812e640ce521bc273f6da56e320dfc3 Mon Sep 17 00:00:00 2001 From: kishore-144 <225003069@sastra.ac.in> Date: Sat, 12 Jul 2025 23:25:11 +0530 Subject: [PATCH] fix: parse width and height from string to int in ImageAsset options to avoid JSONException --- packages/core/image-asset/index.android.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/core/image-asset/index.android.ts b/packages/core/image-asset/index.android.ts index 055caeff60..66073a0089 100644 --- a/packages/core/image-asset/index.android.ts +++ b/packages/core/image-asset/index.android.ts @@ -26,6 +26,15 @@ export class ImageAsset extends ImageAssetBase { } public getImageAsync(callback: (image, error) => void) { + if (this.options) { + if (typeof this.options.width === 'string') { + this.options.width = parseInt(this.options.width, 10) || 0; + } + if (typeof this.options.height === 'string') { + this.options.height = parseInt(this.options.height, 10) || 0; + } + } + org.nativescript.widgets.Utils.loadImageAsync( ad.getApplicationContext(), this.android, @@ -42,4 +51,5 @@ export class ImageAsset extends ImageAssetBase { }) ); } + }