File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -93,12 +93,11 @@ private static ImageSource LoadInternal(string path)
93
93
bool imageInsideWoxDirectory = IsSubdirectory ( parent1 , subPath ) || IsSubdirectory ( parent2 , subPath ) ;
94
94
if ( normalImage && imageInsideWoxDirectory )
95
95
{
96
- var bitmapImage = new BitmapImage ( new Uri ( path ) )
96
+ image = new BitmapImage ( new Uri ( path ) )
97
97
{
98
98
DecodePixelHeight = 32 ,
99
99
DecodePixelWidth = 32
100
100
} ;
101
- image = bitmapImage ;
102
101
image . Freeze ( ) ;
103
102
return image ;
104
103
}
@@ -159,10 +158,16 @@ private static ImageSource LoadInternal(string path)
159
158
160
159
private static ImageSource GetErrorImage ( )
161
160
{
162
- ShellFile shellFile = ShellFile . FromFilePath ( Constant . ErrorIcon ) ;
163
- // small is (32, 32), refer comment above
164
- ImageSource image = shellFile . Thumbnail . SmallBitmapSource ;
165
- image . Freeze ( ) ;
161
+ ImageSource image = _cache . GetOrAdd ( Constant . ErrorIcon , ( _ ) =>
162
+ {
163
+ BitmapImage bitmap = new BitmapImage ( new Uri ( Constant . ErrorIcon ) )
164
+ {
165
+ DecodePixelHeight = 32 ,
166
+ DecodePixelWidth = 32
167
+ } ;
168
+ bitmap . Freeze ( ) ;
169
+ return bitmap ;
170
+ } ) ;
166
171
return image ;
167
172
}
168
173
You can’t perform that action at this time.
0 commit comments