From d30d69ea4f9e87a1c819f4d96c4c38f8ffcd5f31 Mon Sep 17 00:00:00 2001 From: nikkho Date: Sun, 30 Oct 2016 20:00:44 +0000 Subject: [PATCH] Disable Leanify in PNG and ICO when Copy Metadata is checked (ZonaCasio) git-svn-id: svn://svn.code.sf.net/p/nikkhokkho/code/trunk@610 ddd8a7e7-04a1-4c0d-ae79-48073a28b335 --- FileOptimizer/Changelog.txt | 4 ++-- FileOptimizer/Source/cppMain.cpp | 12 ++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/FileOptimizer/Changelog.txt b/FileOptimizer/Changelog.txt index 459d91b..f9a3755 100644 --- a/FileOptimizer/Changelog.txt +++ b/FileOptimizer/Changelog.txt @@ -177,9 +177,9 @@ ndo X.XX - YYYY/MM/DD - Installer now supports the /AllUsers argument to install for all users instead of current user (Grahame Bevan). - Fixed remove selected files (Shift-Del) always enabled since 9.00 when unified ribbon and regular UI (TPS). -- Add original and optimized sizes in log file (JoeW). +- Added original and optimized sizes in log file (JoeW). - Fixed a bug in mutool that prevented execution on PDF (LeTiger). -- Disabled Leanify from the JPEG toolchain when copy metadata is enabled, because it removed IPTC information (ZonaCasio). +- Disabled Leanify from the JPEG, PNG and ICO toolchains when copy metadata is enabled, because it removed IPTC information (ZonaCasio). - Updated to ECT 0.6.2.0 -511fa96- x86 and x64 optimized builds (thanks Malloc Voidstar). - Updated jsmin custom build with Visual C++ 2015. - Updated Leanify to 0.4.3.159 daily binaries. diff --git a/FileOptimizer/Source/cppMain.cpp b/FileOptimizer/Source/cppMain.cpp index cd1e4d3..e1f7936 100644 --- a/FileOptimizer/Source/cppMain.cpp +++ b/FileOptimizer/Source/cppMain.cpp @@ -1179,7 +1179,11 @@ void __fastcall TfrmMain::actOptimizeFor(TObject *Sender, int iCount) iLevel = ((gudtOptions.iLevel * gudtOptions.iLevel * gudtOptions.iLevel) / 25) + 1; //1, 1, 2, 3, 6, 9, 14, 21, 30 } sFlags += "-i " + (String) iLevel + " "; - RunPlugin((unsigned int) iCount, "Leanify", (sPluginsDirectory + "leanify.exe -q " + sFlags + "\"%TMPINPUTFILE%\"").c_str(), sPluginsDirectory, sInputFile, "", 0, 0); + //Temporary disable Leanify because it removed IPTC metadata + if (!gudtOptions.bPNGCopyMetadata) + { + RunPlugin((unsigned int) iCount, "Leanify", (sPluginsDirectory + "leanify.exe -q " + sFlags + "\"%TMPINPUTFILE%\"").c_str(), sPluginsDirectory, sInputFile, "", 0, 0); + } } } // JPEG: jpeg-recompress, jhead, Leanify, ect, jpegoptim, jpegtran, mozjpegtran @@ -1537,7 +1541,11 @@ void __fastcall TfrmMain::actOptimizeFor(TObject *Sender, int iCount) iLevel = ((gudtOptions.iLevel * gudtOptions.iLevel * gudtOptions.iLevel) / 25) + 1; //1, 1, 2, 3, 6, 9, 14, 21, 30 } sFlags += "-i " + (String) iLevel + " "; - RunPlugin((unsigned int) iCount, "Leanify", (sPluginsDirectory + "leanify.exe -q " + sFlags + "\"%TMPINPUTFILE%\"").c_str(), sPluginsDirectory, sInputFile, "", 0, 0); + //Temporary disable Leanify because it removed IPTC metadata + if (!gudtOptions.bPNGCopyMetadata) + { + RunPlugin((unsigned int) iCount, "Leanify", (sPluginsDirectory + "leanify.exe -q " + sFlags + "\"%TMPINPUTFILE%\"").c_str(), sPluginsDirectory, sInputFile, "", 0, 0); + } sFlags = ""; //iLevel = min(gudtOptions.iLevel * 7 / 9, 7) + 1;