working on new Gif viewer

This commit is contained in:
Paddy Xu
2018-06-13 18:43:33 +03:00
parent d4feb2c867
commit c13839cb19
11 changed files with 429 additions and 139 deletions

View File

@@ -0,0 +1,35 @@
using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Text;
namespace QuickLook.Plugin.CameraRawViewer
{
internal class DCraw
{
private static readonly string DCrawPath =
Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location),
Environment.Is64BitProcess ? "dcraw64.exe" : "dcraw32.exe");
public static string ConvertToTiff(string input)
{
var output = Path.GetTempFileName();
using (var p = new Process())
{
p.StartInfo.UseShellExecute = false;
p.StartInfo.CreateNoWindow = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.FileName = DCrawPath;
p.StartInfo.Arguments = $"-w -W -h -T -O \"{output}\" \"{input}\"";
p.StartInfo.StandardOutputEncoding = Encoding.UTF8;
p.Start();
p.WaitForExit(10000);
}
return new FileInfo(output).Length > 0 ? output : string.Empty;
}
}
}