Skip to content

Image.getSize not working with ms-appdata scheme #930

@thebreiflabb

Description

@thebreiflabb

This issue might be somewhat related to #925.

Our app saves images during runtime in LocalFolder, which we then reference with the ms-appdata scheme (reference). Which I think is the intended usage through react-native on Windows.

When image caching for network images in v0.38.0 was introduced, Image.getSize(url) stopped working for this ms-appdata scheme.

To reproduce the issue, I try to get the size of an already saved image:

Image.getSize('ms-appdata:///local/offlineFiles/47EA90CA32A9ABE08DC5FBFAE2CD6D74.jpg', (width, height) => {
	console.log(`Got size: ${width}x${height}`);
}, (e) => {
	console.log(`Getting size failed`);
	console.log(e);
});

This throws an exception in ImageLoaderModule.getSize

var bitmapImage = await ImageCache.Instance.GetFromCacheAsync(new Uri(uriString), true);

imagesize-exception

This could possibly be fixed by handling network images and local images differently as in the fix to #925

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions