1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-04-23 03:15:48 +02:00

Fix file type description in Save image dialog

This commit is contained in:
chylex 2017-07-21 11:16:47 +02:00
parent b1ef00746f
commit cb24a859f4

View File

@ -49,14 +49,14 @@ public static string GetImageLink(string url, ImageQuality quality){
public static void DownloadImage(string url, ImageQuality quality){
string file = BrowserUtils.GetFileNameFromUrl(ExtractImageBaseLink(url));
string ext = Path.GetExtension(file);
string ext = Path.GetExtension(file); // includes dot
using(SaveFileDialog dialog = new SaveFileDialog{
AutoUpgradeEnabled = true,
OverwritePrompt = true,
Title = "Save image",
FileName = file,
Filter = "Image ("+(string.IsNullOrEmpty(ext) ? "unknown" : ext)+")|*.*"
Filter = string.IsNullOrEmpty(ext) ? "Image (unknown)|*.*" : $"Image (*{ext})|*{ext}"
}){
if (dialog.ShowDialog() == DialogResult.OK){
BrowserUtils.DownloadFileAsync(GetImageLink(url, quality), dialog.FileName, null, ex => {