Skip to content

Fixed Image.getSize() to get the right size when fetching local files#15609

Merged
HariniMalothu17 merged 9 commits intomicrosoft:0.81-stablefrom
HariniMalothu17:user/getSize/Imageissue
Feb 3, 2026
Merged

Fixed Image.getSize() to get the right size when fetching local files#15609
HariniMalothu17 merged 9 commits intomicrosoft:0.81-stablefrom
HariniMalothu17:user/getSize/Imageissue

Conversation

@HariniMalothu17
Copy link
Copy Markdown
Contributor

@HariniMalothu17 HariniMalothu17 commented Jan 29, 2026

Description

Fixed [Image.getSize()] to properly initialize the memory stream when fetching local files, enabling support for , ms-appx://, and ms-appdata:// URI schemes

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Why

Added support for local file URI schemes (, ms-appx://, ms-appdata://) by including them in the condition that calls [GetImageStreamAsync()
Added Error handling to print E_INVALID_URI
This error is thrown when the URI provided is empty or null.
E_GET_SIZE_FAILURE
This error is thrown when the image cannot be loaded or decoded for any reason. This includes scenarios such as: the file does not exist at the specified path, the folder path is invalid, the application does not have permission to access the file, the network request fails due to server being unreachable or returning an HTTP error (like 404 Not Found or 403 Forbidden)

Resolves #15603

What

This change fixes the Image.getSize() API to properly support local file URIs on Windows.

Screenshots

image

Testing

Working in playground as expected

Changelog

Should this change be included in the release notes: yes

Add a brief summary of the change to use in the release notes for the next release.

Microsoft Reviewers: Open in CodeFlow

@HariniMalothu17 HariniMalothu17 requested a review from a team as a code owner January 29, 2026 15:32
@HariniMalothu17 HariniMalothu17 changed the title Fix memoryStram getting unitialized Fix memoryStream getting unitialized Jan 29, 2026
@HariniMalothu17 HariniMalothu17 changed the title Fix memoryStream getting unitialized Fix memoryStream getting unitialized and fetching local files Jan 30, 2026
@HariniMalothu17 HariniMalothu17 changed the title Fix memoryStream getting unitialized and fetching local files Fixed Image.getSize() to properly initialize the memory stream when fetching local files Jan 30, 2026
Copy link
Copy Markdown
Contributor

@vineethkuttan vineethkuttan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Raise PR to add to the main and 0.82

@HariniMalothu17 HariniMalothu17 changed the title Fixed Image.getSize() to properly initialize the memory stream when fetching local files Fixed Image.getSize() to get the right size when fetching local files Feb 2, 2026
@HariniMalothu17 HariniMalothu17 merged commit 358c035 into microsoft:0.81-stable Feb 3, 2026
91 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants