Skip to content

Commit 1a688f6

Browse files
authored
Fix thumbnails getting squished into squares (#6434)
1 parent e5bae98 commit 1a688f6

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

Files/ViewModels/ItemViewModel.cs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,7 @@ public bool IsLoadingItems
751751
}
752752
}
753753

754-
private async Task LoadItemThumbnail(ListedItem item, uint thumbnailSize = 20, IStorageItem matchingStorageItem = null, bool forceReload = false)
754+
private async Task LoadItemThumbnail(ListedItem item, uint thumbnailSize = 20, IStorageItem matchingStorageItem = null)
755755
{
756756
var wasIconLoaded = false;
757757
if (item.IsLibraryItem || item.PrimaryItemAttribute == StorageItemTypes.File || item.IsZipItem)
@@ -775,9 +775,7 @@ await CoreApplication.MainView.DispatcherQueue.EnqueueAsync(async () =>
775775
item.FileImage ??= new BitmapImage();
776776
item.FileImage.DecodePixelType = DecodePixelType.Logical;
777777
item.FileImage.DecodePixelWidth = (int)thumbnailSize;
778-
item.FileImage.DecodePixelHeight = (int)thumbnailSize;
779778
await item.FileImage.SetSourceAsync(Thumbnail);
780-
781779
}, Windows.System.DispatcherQueuePriority.Normal);
782780
wasIconLoaded = true;
783781
}
@@ -837,9 +835,7 @@ await CoreApplication.MainView.DispatcherQueue.EnqueueAsync(async () =>
837835
item.FileImage ??= new BitmapImage();
838836
item.FileImage.DecodePixelType = DecodePixelType.Logical;
839837
item.FileImage.DecodePixelWidth = (int)thumbnailSize;
840-
item.FileImage.DecodePixelHeight = (int)thumbnailSize;
841838
await item.FileImage.SetSourceAsync(Thumbnail);
842-
843839
}, Windows.System.DispatcherQueuePriority.Normal);
844840
wasIconLoaded = true;
845841
}
@@ -927,7 +923,7 @@ await Task.Run(async () =>
927923
if (matchingStorageFile != null)
928924
{
929925
cts.Token.ThrowIfCancellationRequested();
930-
await LoadItemThumbnail(item, thumbnailSize, matchingStorageFile, true);
926+
await LoadItemThumbnail(item, thumbnailSize, matchingStorageFile);
931927

932928
var syncStatus = await CheckCloudDriveSyncStatusAsync(matchingStorageFile);
933929
var fileFRN = await FileTagsHelper.GetFileFRN(matchingStorageFile);
@@ -948,7 +944,7 @@ await CoreApplication.MainView.DispatcherQueue.EnqueueAsync(() =>
948944
}
949945
if (!wasSyncStatusLoaded)
950946
{
951-
await LoadItemThumbnail(item, thumbnailSize, null, true);
947+
await LoadItemThumbnail(item, thumbnailSize, null);
952948
}
953949
}
954950
else
@@ -960,7 +956,7 @@ await CoreApplication.MainView.DispatcherQueue.EnqueueAsync(() =>
960956
if (matchingStorageFolder != null)
961957
{
962958
cts.Token.ThrowIfCancellationRequested();
963-
await LoadItemThumbnail(item, thumbnailSize, matchingStorageFolder, true);
959+
await LoadItemThumbnail(item, thumbnailSize, matchingStorageFolder);
964960
if (matchingStorageFolder.DisplayName != item.ItemName && !matchingStorageFolder.DisplayName.StartsWith("$R"))
965961
{
966962
cts.Token.ThrowIfCancellationRequested();
@@ -996,7 +992,7 @@ await CoreApplication.MainView.DispatcherQueue.EnqueueAsync(() =>
996992
if (!wasSyncStatusLoaded)
997993
{
998994
cts.Token.ThrowIfCancellationRequested();
999-
await LoadItemThumbnail(item, thumbnailSize, null, true);
995+
await LoadItemThumbnail(item, thumbnailSize, null);
1000996
}
1001997
}
1002998

0 commit comments

Comments
 (0)