From 0d3eb1cdb7c4536b17aafd70708157cc65c7e3f4 Mon Sep 17 00:00:00 2001 From: Alex <4lex49@zoho.com> Date: Sun, 18 Feb 2018 20:17:48 +0300 Subject: [PATCH 1/4] ~ Fix building errors for gcc 5.x.x. --- Despeckle.cpp | 1 + ProjectPages.cpp | 1 + Utils.h | 2 ++ 3 files changed, 4 insertions(+) diff --git a/Despeckle.cpp b/Despeckle.cpp index 25f235e50..f293e28a9 100644 --- a/Despeckle.cpp +++ b/Despeckle.cpp @@ -23,6 +23,7 @@ #include "FastQueue.h" #include "imageproc/BinaryImage.h" #include "imageproc/ConnectivityMap.h" +#include #include #include diff --git a/ProjectPages.cpp b/ProjectPages.cpp index 13777bb28..70d8e129d 100644 --- a/ProjectPages.cpp +++ b/ProjectPages.cpp @@ -23,6 +23,7 @@ #include "PageSequence.h" #include "RelinkablePath.h" #include "AbstractRelinker.h" +#include #include #include #include diff --git a/Utils.h b/Utils.h index b7f4b9b9e..513cb7c8d 100644 --- a/Utils.h +++ b/Utils.h @@ -21,6 +21,8 @@ #include #include "ThumbnailPixmapCache.h" +#include +#include class Utils { public: From 3a840030fc87551ed50ab083cde00a5c3aaf026b Mon Sep 17 00:00:00 2001 From: Alex <4lex49@zoho.com> Date: Mon, 19 Feb 2018 11:05:20 +0300 Subject: [PATCH 2/4] UI fixes for the dialog of default parameters. --- DefaultParamsDialog.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/DefaultParamsDialog.cpp b/DefaultParamsDialog.cpp index 4794012a9..045f46eb7 100644 --- a/DefaultParamsDialog.cpp +++ b/DefaultParamsDialog.cpp @@ -963,6 +963,7 @@ void DefaultParamsDialog::profileChanged(const int index) { if (index == customProfileItemIdx) { profileCB->setEditText(profileCB->currentText()); profileCB->lineEdit()->selectAll(); + profileCB->setFocus(); profileSaveButton->setEnabled(true); profileDeleteButton->setEnabled(false); setTabWidgetsEnabled(true); @@ -998,6 +999,7 @@ void DefaultParamsDialog::profileChanged(const int index) { QMessageBox::critical(this, tr("Error"), tr("Error loading the profile.")); profileCB->setCurrentIndex(0); profileCB->removeItem(index); + customProfileItemIdx--; profileSaveButton->setEnabled(false); profileDeleteButton->setEnabled(false); @@ -1037,16 +1039,15 @@ void DefaultParamsDialog::profileSavePressed() { } void DefaultParamsDialog::profileDeletePressed() { - const ScopedIncDec scopeGuard(ignoreProfileChanges); - if (profileManager.deleteProfile(profileCB->currentText())) { - const int deletedProfileIndex = profileCB->currentIndex(); - profileCB->setCurrentIndex(customProfileItemIdx--); - profileCB->removeItem(deletedProfileIndex); + { + const ScopedIncDec scopeGuard(ignoreProfileChanges); - profileSaveButton->setEnabled(true); - profileDeleteButton->setEnabled(false); - setTabWidgetsEnabled(true); + const int deletedProfileIndex = profileCB->currentIndex(); + profileCB->setCurrentIndex(customProfileItemIdx--); + profileCB->removeItem(deletedProfileIndex); + } + profileChanged(customProfileItemIdx); } else { QMessageBox::critical(this, tr("Error"), tr("Error deleting the profile.")); } From c9e3b4bf5f4a03db5666e6690b3f224a58a62bc0 Mon Sep 17 00:00:00 2001 From: Alex <4lex49@zoho.com> Date: Mon, 19 Feb 2018 12:39:46 +0300 Subject: [PATCH 3/4] Fixed a possible crash at the output stage: STA used the wrong crop area for background estimation. --- filters/output/OutputGenerator.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/filters/output/OutputGenerator.cpp b/filters/output/OutputGenerator.cpp index 0fc888731..dd70b4c72 100644 --- a/filters/output/OutputGenerator.cpp +++ b/filters/output/OutputGenerator.cpp @@ -576,7 +576,7 @@ namespace output { }(); QColor outsideBackgroundColor = BackgroundColorCalculator::calcDominantBackgroundColor( - inputOrigImage.allGray() ? inputGrayImage : inputOrigImage, m_xform.resultingPreCropArea() + inputOrigImage.allGray() ? inputGrayImage : inputOrigImage, m_xform.preCropArea() ); const bool needNormalizeIllumination @@ -867,7 +867,7 @@ namespace output { if (needNormalizeIllumination && !render_params.normalizeIlluminationColor()) { outsideBackgroundColor = BackgroundColorCalculator::calcDominantBackgroundColor( - inputOrigImage.allGray() ? inputGrayImage : inputOrigImage, m_xform.resultingPreCropArea() + inputOrigImage.allGray() ? inputGrayImage : inputOrigImage, m_xform.preCropArea() ); if (inputOrigImage.allGray()) { @@ -1133,7 +1133,7 @@ namespace output { }(); QColor outsideBackgroundColor = BackgroundColorCalculator::calcDominantBackgroundColor( - inputOrigImage.allGray() ? inputGrayImage : inputOrigImage, m_xform.resultingPreCropArea() + inputOrigImage.allGray() ? inputGrayImage : inputOrigImage, m_xform.preCropArea() ); const bool color_original = !inputOrigImage.allGray(); @@ -1775,7 +1775,7 @@ namespace output { if (needNormalizeIllumination && !render_params.normalizeIlluminationColor()) { outsideBackgroundColor = BackgroundColorCalculator::calcDominantBackgroundColor( - inputOrigImage.allGray() ? inputGrayImage : inputOrigImage, m_xform.resultingPreCropArea() + inputOrigImage.allGray() ? inputGrayImage : inputOrigImage, m_xform.preCropArea() ); QImage orig_without_illumination; From ee73c6f8f44b52ee37b578879f59df9217d50dd1 Mon Sep 17 00:00:00 2001 From: Alex <4lex49@zoho.com> Date: Mon, 19 Feb 2018 12:48:57 +0300 Subject: [PATCH 4/4] ~ Update VERSION. --- version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.h b/version.h index e0ac13349..1b3c5fb11 100644 --- a/version.h +++ b/version.h @@ -19,7 +19,7 @@ #ifndef SCANTAILOR_VERSION_H_ #define SCANTAILOR_VERSION_H_ -#define VERSION "1.0.10" +#define VERSION "1.0.11" #define VERSION_QUAD "" // Must be "x.x.x.x" or an empty string. #define PROJECT_VERSION 2