-
Notifications
You must be signed in to change notification settings - Fork 1.4k
ImageEx: DecodePixelHeight, DecodePixelType and DecodePixelWidth properties #931
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…s to ImageEx Modify CacheBase GetItemAsync to pass list of KeyValuePair objects to pass to generic type instantiation
|
Addresses issue #888 |
| /// <param name="initializerKeyValues">key value pairs used when initializing instance of generic type</param> | ||
| /// <returns>awaitable task</returns> | ||
| protected override async Task<BitmapImage> InitializeTypeAsync(StorageFile baseFile) | ||
| protected override async Task<BitmapImage> InitializeTypeAsync(StorageFile baseFile, List<KeyValuePair<string, object>> initializerKeyValues) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be set to null by default to avoid breaking changes
| /// <param name="initializerKeyValues">key value pairs used when initializing instance of generic type</param> | ||
| /// <returns>awaitable task</returns> | ||
| protected override async Task<BitmapImage> InitializeTypeAsync(IRandomAccessStream stream) | ||
| protected override async Task<BitmapImage> InitializeTypeAsync(IRandomAccessStream stream, List<KeyValuePair<string, object>> initializerKeyValues) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be set to null by default to avoid breaking changes
| /// <param name="initializerKeyValues">key value pairs used when initializing instance of generic type</param> | ||
| /// <returns>awaitable task</returns> | ||
| protected abstract Task<T> InitializeTypeAsync(IRandomAccessStream stream); | ||
| protected abstract Task<T> InitializeTypeAsync(IRandomAccessStream stream, List<KeyValuePair<string, object>> initializerKeyValues); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be set to null by default to avoid breaking changes (true for all protected methods ;))
deltakosh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few changes but overall LGTM
shenchauhan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of quick changes
| var img = await ImageCache.Instance.GetFromCacheAsync(_uri, true, _tokenSource.Token); | ||
| var propValues = new List<KeyValuePair<string, object>>(); | ||
|
|
||
| if (DecodePixelHeight != 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<= 0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
again sorry, should have said > 0
| propValues.Add(new KeyValuePair<string, object>(nameof(DecodePixelHeight), DecodePixelHeight)); | ||
| } | ||
|
|
||
| if (DecodePixelWidth != 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<= 0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry should have said >0
Add DecodePixelHeight, DecodePixelType and DecodePixelWidth properties to ImageEx
Modify CacheBase GetItemAsync to pass list of KeyValuePair objects to pass to generic type instantiation