Skip to content

Commit 39eb65b

Browse files
author
shibayan
committed
Optimize memory usage in Image preview / Add support text extensions
1 parent 568a5b5 commit 39eb65b

File tree

5 files changed

+9
-7
lines changed

5 files changed

+9
-7
lines changed

src/WinQuickLook/Converters/FileInfoToFileSizeConverter.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
namespace WinQuickLook.Converters
88
{
9-
[ValueConversion(typeof(long), typeof(string))]
9+
[ValueConversion(typeof(FileSystemInfo), typeof(string))]
1010
public class FileInfoToFileSizeConverter : IValueConverter
1111
{
1212
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)

src/WinQuickLook/Handlers/ImagePreviewHandler.cs

+5
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ private static BitmapSource GetImage(string fileName)
6464

6565
bitmap.Freeze();
6666

67+
if (Math.Abs(bitmap.DpiX - 96.0) < 0.1 && Math.Abs(bitmap.DpiY - 96.0) < 0.1)
68+
{
69+
return bitmap;
70+
}
71+
6772
int stride = bitmap.PixelWidth * 4;
6873
var pixels = new byte[stride * bitmap.PixelHeight];
6974

src/WinQuickLook/Handlers/TextPreviewHandler.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public override FrameworkElement GetElement(string fileName)
4444

4545
private static readonly string[] _supportFormats =
4646
{
47-
".txt", ".log", ".md", ".markdown", ".xml"
47+
".txt", ".log", ".md", ".markdown", ".xml", ".config", ".gitignore", ".gitattributes"
4848
};
4949

5050
private static Encoding DetectEncoding(byte[] contents)

src/WinQuickLook/Properties/AssemblyInfo.cs

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
using System.Reflection;
2-
using System.Resources;
3-
using System.Runtime.CompilerServices;
42
using System.Runtime.InteropServices;
53
using System.Windows;
64

@@ -51,5 +49,4 @@
5149
// すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を
5250
// 既定値にすることができます:
5351
// [assembly: AssemblyVersion("1.0.*")]
54-
[assembly: AssemblyVersion("1.0.0.0")]
55-
[assembly: AssemblyFileVersion("1.0.0.0")]
52+
[assembly: AssemblyVersion("1.1.0.0")]

src/WinQuickLook/app.manifest

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
3-
<assemblyIdentity version="1.0.0.0" name="WinQuickLook"/>
3+
<assemblyIdentity version="1.1.0.0" name="WinQuickLook"/>
44
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
55
<security>
66
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">

0 commit comments

Comments
 (0)