Skip to content

Commit

Permalink
Alpha Deathclaw fix
Browse files Browse the repository at this point in the history
  • Loading branch information
madelson committed Jun 21, 2024
1 parent fb0b69d commit 0a7ef74
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Binary file modified cards/Alpha Deathclaw.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 9 additions & 1 deletion gallery/BuildGallery.linq
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,15 @@ async Task CompressCardImagesAsync()
.Where(c => new FileInfo(c).Length > 2_000_000);
await Parallel.ForEachAsync(rawCardImages, async (rawCardImage, _) =>
{
File.Copy(rawCardImage, Path.Combine(RawImageRepository, Path.GetFileName(rawCardImage)));
$"Compressing {Path.GetFileName(rawCardImage)}".Dump();
var rawImageStorePath = Path.Combine(RawImageRepository, Path.GetFileName(rawCardImage));
if (File.Exists(rawImageStorePath))
{
var rawImageHistoryPath = Path.Combine(RawImageRepository, "Old Versions", Path.GetFileNameWithoutExtension(rawCardImage) + DateTime.Now.ToString("yyyyMMddHHmmss") + Path.GetExtension(rawCardImage));
Directory.CreateDirectory(Path.GetDirectoryName(rawImageHistoryPath)!);
File.Move(rawImageStorePath, rawImageHistoryPath);
}
File.Copy(rawCardImage, rawImageStorePath);
await (await Tinify.FromFile(rawCardImage)).ToFile(rawCardImage);
if (new FileInfo(rawCardImage).Length > 1_500_000)
{
Expand Down

0 comments on commit 0a7ef74

Please sign in to comment.