Bug#922574: digiKam FTBFS with OpenCV 4

2020-02-05 Thread Agustin Martin
On Fri, Jan 17, 2020 at 04:35:04PM +0100, Agustin Martin wrote:
> On Tue, Dec 10, 2019 at 01:55:50PM -0500, John Scott wrote:
> > Control: forwarded -1 https://bugs.kde.org/show_bug.cgi?id=401306
> > 
> > This appears to have been fixed upstream. There are a couple patches there.
> 
> Hi all,
> 
> I have been playing with this problem and with changes in upstream bug
> report and I was finally able to make digikam 5.9.0 build in sid. 

Hi, Steve,

Thanks a lot for uploading digikam 6.4.0. Since this #922574 bug report was
not closed with it, I guess you want to give this upload an extended time
before testing migration.

Minimally tested but it is apparently fixing #918478 too.

Some other bug reports were filed for older digikam versions and may no
longer apply. Do you mind if I mail submitters to double check that before
closing those bug reports?

Thanks for your work in digikam.

Regards,

-- 
Agustin



Bug#922574: digiKam FTBFS with OpenCV 4

2020-01-17 Thread Agustin Martin
On Tue, Dec 10, 2019 at 01:55:50PM -0500, John Scott wrote:
> Control: forwarded -1 https://bugs.kde.org/show_bug.cgi?id=401306
> 
> This appears to have been fixed upstream. There are a couple patches there.

Hi all,

I have been playing with this problem and with changes in upstream bug
report and I was finally able to make digikam 5.9.0 build in sid. 

I have prepared a personal build with those changes (it is minimally
tested, so is initially intended for my personal use), and I am attaching a
debdiff with the changes as well as individual patches under debian/patches
for clarity.

That personal build is apparently working for my preliminary tests and
is intended to fix both
  
  #922574 digikam: FTBFS against opencv 4
  #918478 digikam: ImageEditor window is blank when opened a second time

as well as a problem with libkf5calendar.

Steve, feel free to use these changes at your convenience. If needed I can
prepare a NMU, but I would appreciate some additional testing first.

Summary of the patches under debian/patches follow:

 * 0010_libopencv.h_update-for-opencv4-remove-obsolete-stuff.diff:
   Update libopencv.h.cmake.in for opencv4 and remove obsolete stuff.
   Based on upstream changes in https://bugs.kde.org/show_bug.cgi?id=401306.

 * 0011_facesengine_fix-openCV4-compilation.diff:
   Update for opencv4 (and some opencv3).
   Original patch by Gilles Caulier modified to deal with buster opencv
   (seems that it also needs to use cv::IMREAD_GRAYSCALE). Version should
   be fine tuned, but seems to work with both buster and sid.

 * 0020_calsettings.cpp_Fix-for-recent-libkf5calendarcore.diff:
   Fix calsettings.cpp for libkf5calendarcore-dev_4%3a19.08.3
   KCalCore namespace has been renamed to KCalendarCore. Just set a
   namespace alias to work around this.

   This will not work for buster libkf5calendarcore-dev_4%3a18.08.3.
   Comment that alias if a backport is needed.

 * 0030_fix-blank-imageeditor.patch:
   Fix ImageEditor window is blank when opened a second time (#918478)
   Changes borrowed from http://bugs.debian.org/918478

Please find attached above patches and the debdiff for my personal build.

Hope this helps

-- 
Agustin
From: Aguatin Martin 
Date: 20200117
Subject: Update libopencv.h.cmake.in for opencv4 and remove obsolete stuff

Based on changes by Gilles Caulier for recent digikam.

--- a/core/app/utils/libopencv.h.cmake.in
+++ b/core/app/utils/libopencv.h.cmake.in
@@ -49,35 +49,26 @@
 #define OPENCV_VERSION OPENCV_MAKE_VERSION(CV_MAJOR_VERSION,CV_MINOR_VERSION,CV_SUBMINOR_VERSION)
 #define OPENCV_TEST_VERSION(major,minor,patch) ( OPENCV_VERSION < OPENCV_MAKE_VERSION(major,minor,patch) )
 
-#if OPENCV_TEST_VERSION(2,5,0)
-#   include 
-#   include 
-#   include 
-#   include 
-#else
-#   include 
-#   include 
-#   include 
-#   include 
-#endif
+// Core module headers
 
-#if OPENCV_TEST_VERSION(3,0,0)
-#   include 
-#   include 
-#   include 
-#else
-#   include 
 #   include 
 #   include 
 #   include 
+#include 
+#include 
+
+// Object detection module headers
+
+#include 
+
+// Image codecs module headers
+
 #   include 
-#   include 
-#endif
 
-// for old-style code
-#if OPENCV_VERSION <= OPENCV_MAKE_VERSION(2,4,99)
-#   include 
-#endif
+// Image processing module headers
+
+#include 
+#include 
 
 // Restore warnings
 #if !defined(__APPLE__) && defined(__GNUC__)
>From 7a5af66d8fc7ab8e78f05016eaf3e94de66951b3 Mon Sep 17 00:00:00 2001
From: Gilles Caulier 
Date: Fri, 15 Mar 2019 17:16:06 +0100
Subject: fix broken compilation with OpenCV4 in Test::FaceEngine CCBUGS:
 401306

Modified by Agustin martin to lower version in OPENCV test to (2,99,0)
Was (3,99,0), but buster opencv version is lower and already needs
this change.

---
 core/tests/facesengine/preprocess.cpp | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

--- a/core/tests/facesengine/preprocess.cpp
+++ b/core/tests/facesengine/preprocess.cpp
@@ -63,7 +63,13 @@ QList toImages(const QStringLis
 foreach (const QString& path, paths)
 {
 QByteArray s = path.toLocal8Bit();
-images << cv::imread(std::string(s.data()), CV_LOAD_IMAGE_GRAYSCALE);
+images << cv::imread(std::string(s.data()),
+#if OPENCV_TEST_VERSION(2,99,0)
+CV_LOAD_IMAGE_GRAYSCALE
+#else
+cv::IMREAD_GRAYSCALE
+#endif
+);
 }
 
 return images;
--- a/core/libs/facesengine/detection/opencvfacedetector.cpp
+++ b/core/libs/facesengine/detection/opencvfacedetector.cpp
@@ -366,7 +366,7 @@ void OpenCVFaceDetector::updateParameter
  * unless in we want very high sensitivity at low speed
  */
 if (d->sensitivityVsSpecificity > 0.1 || d->speedVsAccuracy < 0.9)
-d->primaryParams.flags = CV_HAAR_DO_CANNY_PRUNING;
+d->primaryParams.flags = cv::CASCADE_DO_CANNY_PRUNING;
 else
 d->primaryParams.flags = 0;
 
From: Agustin Martin 
Date: 20200117
Subject: Fix calsettings.cpp for libkf5calendarcore-dev_4%3a19.08.3

KCalCore 

Bug#922574: digiKam FTBFS with OpenCV 4

2019-12-10 Thread John Scott
Control: forwarded -1 https://bugs.kde.org/show_bug.cgi?id=401306

This appears to have been fixed upstream. There are a couple patches there.