Skip to content

Commit

Permalink
Magick.NET Lossless Compression: show description in the info box
Browse files Browse the repository at this point in the history
  • Loading branch information
d2phap committed Mar 16, 2024
1 parent f4dd71c commit fa8de7f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
9 changes: 5 additions & 4 deletions Source/Components/ImageGlass.Base/Language/IgLang.cs
Original file line number Diff line number Diff line change
Expand Up @@ -412,10 +412,11 @@ public void InitDefaultLanguage()
_ = TryAdd("FrmMain.MnuCropTool", "Crop image"); // v7.6
_ = TryAdd("FrmMain.MnuGetMoreTools", "Get more tools…"); // v9.0

_ = TryAdd("FrmMain.MnuLosslessCompression", "Lossless compression"); // v9.0
_ = TryAdd("FrmMain.MnuLosslessCompression._Description", "This tool uses Magick.NET library for lossless compression, optimizing file size. Overwrites only if the compressed file is smaller than the original.\r\n\r\nDo you want to proceed?"); // v9.0
_ = TryAdd("FrmMain.MnuLosslessCompression._Compressing", "Performing lossless compression…"); // v9.0
_ = TryAdd("FrmMain.MnuLosslessCompression._Done", "Done lossless compression.\r\nThe new file size is {0}, saved {1}."); // v9.0
_ = TryAdd("FrmMain.MnuLosslessCompression", "Magick.NET Lossless Compression"); // v9.1
_ = TryAdd("FrmMain.MnuLosslessCompression._Confirm", "Are you sure you want to proceed?"); // v9.1
_ = TryAdd("FrmMain.MnuLosslessCompression._Description", "This tool uses Magick.NET library for lossless compression, optimizing file size. Overwrites only if the compressed file is smaller than the original."); // v9.1
_ = TryAdd("FrmMain.MnuLosslessCompression._Compressing", "Performing lossless compression…"); // v9.1
_ = TryAdd("FrmMain.MnuLosslessCompression._Done", "Done lossless compression.\r\nThe new file size is {0}, saved {1}."); // v9.1

#endregion

Expand Down
7 changes: 5 additions & 2 deletions Source/ImageGlass/FrmMain/FrmMain.IGMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1371,7 +1371,7 @@ public async Task<bool> SaveCurrentImageAsACopyAsync()
{
srcFilePath = Local.Images.GetFilePath(Local.CurrentIndex);
srcExt = Path.GetExtension(srcFilePath).ToLowerInvariant();


if (Config.OpenSaveAsDialogInTheCurrentImageDir)
{
Expand Down Expand Up @@ -3177,13 +3177,16 @@ public void IG_LosslessCompression()
return;
}


// always show confirmation dialog
var result = Config.ShowInfo(this,
description: $"{filePath}\r\n{Gallery.Items[Local.CurrentIndex].Details.FileSizeFormated}",
title: Config.Language[langPath],
heading: Config.Language[$"{langPath}._Description"],
heading: Config.Language[$"{langPath}._Confirm"],
note: Config.Language[$"{langPath}._Description"],
thumbnail: Gallery.Items[Local.CurrentIndex].ThumbnailImage,
buttons: PopupButton.Yes_No);

if (result.ExitResult != PopupExitResult.OK) return;


Expand Down

0 comments on commit fa8de7f

Please sign in to comment.