Skip to content
This repository has been archived by the owner on Nov 26, 2022. It is now read-only.

Commit

Permalink
Fix palette importer
Browse files Browse the repository at this point in the history
  • Loading branch information
pleonex committed Mar 21, 2015
1 parent 871ede2 commit 30e91bf
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Ekona/Images/PaletteControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ private void btnExport_Click(object sender, EventArgs e)
}
private void btnImport_Click(object sender, EventArgs e)
{
SaveFileDialog o = new SaveFileDialog();
OpenFileDialog o = new OpenFileDialog();
o.CheckFileExists = true;
o.Filter = "All supported formats|*.pal;*.aco;*.png;*.bmp;*.jpg;*.jpeg;*.tif;*.tiff;*.gif;*.ico;*.icon|" +
"Windows Palette (*.pal)|*.pal|" +
Expand All @@ -230,6 +230,14 @@ private void btnImport_Click(object sender, EventArgs e)
return;

string ext = Path.GetExtension(o.FileName).ToLower();
if (string.IsNullOrEmpty(ext) || ext.Length == 0) {
MessageBox.Show("File without extension... Aborting");
return;
}

if (ext.Contains("."))
ext = ext.Substring(ext.LastIndexOf(".") + 1);
Console.WriteLine("File extension:" + ext);
PaletteBase newpal;

if (ext == "pal")
Expand Down

0 comments on commit 30e91bf

Please sign in to comment.