Closed saulgreenberg closed 8 years ago
A solution may be to use the thumbnail creation version e.g., something like BitmapImage img = new BitmapImage(); img.BeginInit(); img.DecodePixelWidth = 400; img.CacheOption = BitmapCacheOption.OnLoad; img.UriSource = new (Uri (...); img.EndInit();
the img should now contain a thumbnail. This is much more efficient than loading the full size image and then scaling it.
The above solution (i.e., with DecodePixeWidth) has been implemented. However, deleting the images is still slow - need to update the dialog to provide feedback as to what is going on as it is happening (including disallowing cancelling)
Thumbnails sizes are now used to generate thumbnails vs. shrinking. A warning to users has also been added for large numbers of deletions. Since large number of deletions are likely rare, this should suffice for now.
If the user tries to delete a large number of images (say well over 1000) it may:
-- we individually update the database to reset the delete flag and the imagequality. I suspect we can significantly speed this up if we create a version of this.database.UpdateImage that wraps all the database requests into a bulk action (e.g., begin / end)