Skip to content

Commit

Permalink
Fixed GimpGplParser
Browse files Browse the repository at this point in the history
  • Loading branch information
flabbet committed Apr 23, 2023
1 parent c490f28 commit 9431ee6
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/PixiEditor/Models/IO/PaletteParsers/GimpGplParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,14 @@ private async Task<PaletteFileData> ParseFile(string path)
if(lines.Length == 0) return PaletteFileData.Corrupted;

List<Color> colors = new();
char[] separators = new[] { '\t', ' ' };
foreach (var colorLine in lines)
{
var colorParts = colorLine.Split('\t', StringSplitOptions.RemoveEmptyEntries);
var colorParts = colorLine.Split(separators, StringSplitOptions.RemoveEmptyEntries);

if (colorParts.Length < 3)
{
if (colorLine.Contains(' '))
{
colorParts = colorLine.Split(' ', StringSplitOptions.RemoveEmptyEntries);
}
else
{
continue;
}
continue;
}

if(colorParts.Length < 3) continue;
Expand Down

0 comments on commit 9431ee6

Please sign in to comment.