From 090a8f860568a45a04b147c5af1b4e60a1f9b7a8 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 10 May 2016 16:38:08 +0530 Subject: [PATCH] Compilation fixes for imageops on linux --- src/calibre/utils/imageops/imageops.cpp | 2 +- src/calibre/utils/imageops/imageops.h | 2 +- src/calibre/utils/imageops/imageops.sip | 1 + src/calibre/utils/imageops/quantize.cpp | 7 +++++-- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/calibre/utils/imageops/imageops.cpp b/src/calibre/utils/imageops/imageops.cpp index 52f68f1ff4..71df9666e5 100644 --- a/src/calibre/utils/imageops/imageops.cpp +++ b/src/calibre/utils/imageops/imageops.cpp @@ -5,8 +5,8 @@ * Distributed under terms of the GPL3 license. */ -#include #include "imageops.h" +#include #include #include diff --git a/src/calibre/utils/imageops/imageops.h b/src/calibre/utils/imageops/imageops.h index 1b5a0ed56d..e477eb8105 100644 --- a/src/calibre/utils/imageops/imageops.h +++ b/src/calibre/utils/imageops/imageops.h @@ -7,8 +7,8 @@ #pragma once -#include #include +#include QImage remove_borders(const QImage &image, double fuzz); QImage grayscale(const QImage &image); diff --git a/src/calibre/utils/imageops/imageops.sip b/src/calibre/utils/imageops/imageops.sip index ed72af2b3c..d1ff602fee 100644 --- a/src/calibre/utils/imageops/imageops.sip +++ b/src/calibre/utils/imageops/imageops.sip @@ -7,6 +7,7 @@ %Import QtGui/QtGuimod.sip %ModuleCode #include +#include #define IMAGEOPS_PREFIX \ if (a0->isNull()) { PyErr_SetString(PyExc_ValueError, "Cannot operate on null QImage"); return NULL; } \ try { diff --git a/src/calibre/utils/imageops/quantize.cpp b/src/calibre/utils/imageops/quantize.cpp index c42ee0d8d4..dfc7c20a92 100644 --- a/src/calibre/utils/imageops/quantize.cpp +++ b/src/calibre/utils/imageops/quantize.cpp @@ -12,12 +12,12 @@ * Distributed under terms of the GPL3 license. */ -#include +#include "imageops.h" +#include #include #include #include #include -#include "imageops.h" // Increasing this number improves quality but also increases running time and memory consumption static const size_t MAX_LEAVES = 2000; @@ -31,6 +31,9 @@ static inline double log2(double x) { return log(x) / log((double)2) ; } #endif #else #include +#ifndef UINT64_MAX +#define UINT64_MAX 18446744073709551615ULL +#endif #endif #define MAX_DEPTH 8 #define MAX_COLORS 256