From 38f2497ce649f8bea166ee32b497d98017e41e25 Mon Sep 17 00:00:00 2001
From: peijiankang <peijiankang@kylinos.cn>
Date: Thu, 25 May 2023 16:33:00 +0800
Subject: [PATCH] fix compile error of kylin-scanner

---
 autogen.sh                                      | 2 +-
 codec/kylinimagecodec/image_load/image_load.cpp | 2 +-
 codec/kylinimagecodec/image_save/image_save.cpp | 2 +-
 codec/kylinimagecodec/kylinimagecodec.cpp       | 4 ++--
 codec/kylinimagecodec/kylinimagecodec.pro       | 2 +-
 translations/generate_translations_pm.sh        | 2 +-
 6 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/autogen.sh b/autogen.sh
index 05fe23e..9b66beb 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,4 +1,4 @@
 #! /bin/sh
 # Run this to generate all the initial makefiles, etc.
 
-lrelease kylin-scanner.pro
+lrelease-qt5 kylin-scanner.pro
diff --git a/codec/kylinimagecodec/image_load/image_load.cpp b/codec/kylinimagecodec/image_load/image_load.cpp
index a922bd7..985b83c 100644
--- a/codec/kylinimagecodec/image_load/image_load.cpp
+++ b/codec/kylinimagecodec/image_load/image_load.cpp
@@ -15,7 +15,7 @@
 * along with this program; if not, see <http://www.gnu.org/licenses/&gt;.
 *
 */
-
+#define STB_IMAGE_IMPLEMENTATION
 #include "kylinimagecodec.h"
 
 MatResult KylinImageCodec::loadImageToMat(QString path)
diff --git a/codec/kylinimagecodec/image_save/image_save.cpp b/codec/kylinimagecodec/image_save/image_save.cpp
index 859275f..45d1b21 100644
--- a/codec/kylinimagecodec/image_save/image_save.cpp
+++ b/codec/kylinimagecodec/image_save/image_save.cpp
@@ -15,7 +15,7 @@
 * along with this program; if not, see <http://www.gnu.org/licenses/&gt;.
 *
 */
-
+#define STB_IMAGE_WRITE_IMPLEMENTATION
 #include "kylinimagecodec.h"
 
 QStringList* KylinImageCodec::m_list = new QStringList;
diff --git a/codec/kylinimagecodec/kylinimagecodec.cpp b/codec/kylinimagecodec/kylinimagecodec.cpp
index 2745187..0746ba8 100644
--- a/codec/kylinimagecodec/kylinimagecodec.cpp
+++ b/codec/kylinimagecodec/kylinimagecodec.cpp
@@ -89,8 +89,8 @@ QHash<QString, int> KylinImageCodec::creatFormats()
     tmpFormats.insert("DDS",FIF_DDS);
     tmpFormats.insert("GIF",FIF_GIF);
     tmpFormats.insert("HDR",FIF_HDR);
-    tmpFormats.insert("FAX",FIF_FAXG3);
-    tmpFormats.insert("G3",FIF_FAXG3);
+//    tmpFormats.insert("FAX",FIF_FAXG3);
+//    tmpFormats.insert("G3",FIF_FAXG3);
     tmpFormats.insert("SGI",FIF_SGI);
     tmpFormats.insert("CUT",FIF_CUT);
     tmpFormats.insert("JNG",FIF_JNG);
diff --git a/codec/kylinimagecodec/kylinimagecodec.pro b/codec/kylinimagecodec/kylinimagecodec.pro
index ccd0b28..44a44be 100644
--- a/codec/kylinimagecodec/kylinimagecodec.pro
+++ b/codec/kylinimagecodec/kylinimagecodec.pro
@@ -24,7 +24,7 @@ LIBS += -lopencv_core \
         -lopencv_imgproc \
 
 #stb
-LIBS += -lstb \
+#LIBS += -lstb \
 
 #gif
 LIBS += -lgif \
diff --git a/translations/generate_translations_pm.sh b/translations/generate_translations_pm.sh
index a5e938e..2359710 100755
--- a/translations/generate_translations_pm.sh
+++ b/translations/generate_translations_pm.sh
@@ -4,5 +4,5 @@ ts_file_list=(`ls translations/*.ts`)
 
 for ts in "${ts_file_list[@]}"
 do
-	lrelease "${ts}"
+	lrelease-qt5 "${ts}"
 done
-- 
2.39.1

