Skip to content

Commit

Permalink
Fix #12
Browse files Browse the repository at this point in the history
  • Loading branch information
ptrsuder committed Nov 9, 2019
1 parent a7a7719 commit 862fff6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions IEU.Core/IEU.cs
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,11 @@ void CreateTiles(FileInfo file, MagickImage inputImage, bool imageHasAlpha, Prof
MagickImage outputImageAlpha = (MagickImage)inputImageAlpha.Clone();
outputImageAlpha.Crop(new MagickGeometry(tile_X1, tile_Y1, tileWidth + xOffset, tileHeight + yOffset));
if (HotProfile.UseDifferentModelForAlpha)
outputImageAlpha.Write($"{lrPathAlpha}{DirectorySeparator}{Path.GetDirectoryName(fileAlpha.FullName).Replace(InputDirectoryPath, "")}{DirectorySeparator}{Path.GetFileNameWithoutExtension(fileAlpha.Name)}_tile-{tileIndex.ToString("D2")}.png");
{
string lrAlphaFolderPath = $"{lrPathAlpha}{Path.GetDirectoryName(fileAlpha.FullName).Replace(InputDirectoryPath, "")}{DirectorySeparator}";
Directory.CreateDirectory(lrAlphaFolderPath);
outputImageAlpha.Write($"{lrAlphaFolderPath}{Path.GetFileNameWithoutExtension(fileAlpha.Name)}_tile-{tileIndex.ToString("D2")}.png");
}
else
outputImageAlpha.Write($"{LrPath}{DirectorySeparator}{Path.GetDirectoryName(fileAlpha.FullName).Replace(InputDirectoryPath, "")}{DirectorySeparator}{Path.GetFileNameWithoutExtension(fileAlpha.Name)}_tile-{tileIndex.ToString("D2")}.png");
}
Expand Down Expand Up @@ -1698,7 +1702,7 @@ async Task<Process> ESRGAN(bool NoWindow, Profile HotProfile)
searchOption = SearchOption.AllDirectories;
SetTotalCounter(Directory.GetFiles(LrPath, "*", searchOption).Count() * checkedModels.Count);
if (HotProfile.UseDifferentModelForAlpha)
SetTotalCounter(FilesTotal + Directory.GetFiles(LrPath + "_alpha").Count());
SetTotalCounter(FilesTotal + Directory.GetFiles(LrPath + "_alpha", "*", searchOption).Count());

ResetDoneCounter();

Expand Down

0 comments on commit 862fff6

Please sign in to comment.