mirror of
https://github.com/QL-Win/QuickLook.git
synced 2025-09-13 19:19:10 +00:00
working on new Gif viewer
This commit is contained in:
35
QuickLook.Plugin/QuickLook.Plugin.CameraRawViewer/DCraw.cs
Normal file
35
QuickLook.Plugin/QuickLook.Plugin.CameraRawViewer/DCraw.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user