summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlberto Sánchez Molero2022-11-04 23:54:11 +0200
committerAlberto Sánchez Molero2022-11-04 23:54:11 +0200
commit665bcf44d4cec99e02e9b5f958369eb725687243 (patch)
treee4009ae43e534bf856fabca3845c03daa66d22fb
parent96f21f6999849a4bcbfd25f529336b6ca42d91da (diff)
downloadaur-665bcf44d4cec99e02e9b5f958369eb725687243.tar.gz
update to 3.2.1, added patch to avoid having PDF attachments appear corrupted
-rw-r--r--.SRCINFO9
-rw-r--r--0001_dont_process_pdf_as_image.patch58
-rw-r--r--PKGBUILD15
3 files changed, 75 insertions, 7 deletions
diff --git a/.SRCINFO b/.SRCINFO
index bb65d849a993..6cf52acef462 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,6 +1,6 @@
pkgbase = kitsas
pkgdesc = Finnish bookkeeping software for small organisations
- pkgver = 2.1.1
+ pkgver = 3.2.1
pkgrel = 1
url = https://kitsas.fi/
arch = x86_64
@@ -8,8 +8,9 @@ pkgbase = kitsas
depends = qt5-svg>=5.12
depends = poppler-qt5
depends = libzip
- source = https://github.com/artoh/kitupiikki/archive/v2.1.1.tar.gz
- sha256sums = 36b6d8611c412ff930169aacb87c8263f61c10dbd163ebaeddb62f05652c4a60
+ source = https://github.com/artoh/kitupiikki/archive/v3.2.1.tar.gz
+ source = 0001_dont_process_pdf_as_image.patch
+ sha256sums = 79574ceefe457eae5e9174577979871618c7cb32bbdd35cce234ff6219017432
+ sha256sums = f0cea2431af21d7640c869856ce16609d340fe45c2c997e72123cea78febc454
pkgname = kitsas
-
diff --git a/0001_dont_process_pdf_as_image.patch b/0001_dont_process_pdf_as_image.patch
new file mode 100644
index 000000000000..879f42a703eb
--- /dev/null
+++ b/0001_dont_process_pdf_as_image.patch
@@ -0,0 +1,58 @@
+diff --git a/kitsas/model/tositeliitteet.cpp b/kitsas/model/tositeliitteet.cpp
+index dca0346f..77f32ccd 100644
+--- a/kitsas/model/tositeliitteet.cpp
++++ b/kitsas/model/tositeliitteet.cpp
+@@ -208,25 +208,29 @@ bool TositeLiitteet::lisaaHeti(QByteArray liite, const QString &tiedostonnimi, c
+ if( liite.isNull())
+ return false;
+
+- // Muunnetaan kaikki kuvatiedostot jpg-kuviksi
+- QImage image = image.fromData(liite);
+- if( !image.isNull()) {
+- int koko = kp()->settings()->value("KuvaKoko",2048).toInt();
+- if( image.width() > image.height()) {
+- if( image.width() > koko) {
+- image = image.scaledToWidth(koko);
++ QString tyyppi = KpKysely::tiedostotyyppi(liite);
++
++ if(tyyppi.startsWith("image/")) {
++ // Muunnetaan kaikki kuvatiedostot jpg-kuviksi
++ QImage image = image.fromData(liite);
++ if( !image.isNull()) {
++ int koko = kp()->settings()->value("KuvaKoko",2048).toInt();
++ if( image.width() > image.height()) {
++ if( image.width() > koko) {
++ image = image.scaledToWidth(koko);
++ }
++ } else {
++ if( image.height() > koko) {
++ image = image.scaledToHeight(koko);
++ }
+ }
+- } else {
+- if( image.height() > koko) {
+- image = image.scaledToHeight(koko);
++ if( kp()->settings()->value("KuvaMustavalko").toBool()) {
++ image = image.convertToFormat(QImage::Format_Grayscale8);
+ }
++ QBuffer buffer(&liite);
++ buffer.open(QIODevice::WriteOnly);
++ image.save(&buffer,"JPG", kp()->settings()->value("KuvaLaatu",40).toInt());
+ }
+- if( kp()->settings()->value("KuvaMustavalko").toBool()) {
+- image = image.convertToFormat(QImage::Format_Grayscale8);
+- }
+- QBuffer buffer(&liite);
+- buffer.open(QIODevice::WriteOnly);
+- image.save(&buffer,"JPG", kp()->settings()->value("KuvaLaatu",40).toInt());
+ } else if ( liite.left(128).contains(QByteArray("<html")) || liite.left(128).contains(QByteArray("<HTML")) ) {
+ QTextDocument doc;
+ doc.setHtml(Tuonti::CsvTuonti::haistettuKoodattu(liite));
+@@ -252,7 +256,6 @@ bool TositeLiitteet::lisaaHeti(QByteArray liite, const QString &tiedostonnimi, c
+ }
+
+
+- QString tyyppi = KpKysely::tiedostotyyppi(liite);
+ if(tyyppi == "application/octet-stream") {
+ if(QMessageBox::question(nullptr, tr("Liitetiedoston tyyppiä ei tueta"),
+ tr("Tätä liitetiedostoa ei voi välttämättä näyttää Kitsaalla eikä sisällyttää arkistoon.\n"
diff --git a/PKGBUILD b/PKGBUILD
index 680fee67ce96..81562ab9aba4 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,7 +1,7 @@
# Maintainer: Alberto Sánchez Molero <alsamolero@gmail.com>
pkgname=kitsas
_reponame=kitupiikki
-pkgver=2.1.1
+pkgver=3.2.1
_repover="${pkgver//_/-}"
pkgrel=1
epoch=
@@ -21,11 +21,20 @@ backup=()
options=()
install=
changelog=
-source=("https://github.com/artoh/$_reponame/archive/v$_repover.tar.gz")
+source=(
+ "https://github.com/artoh/$_reponame/archive/v$_repover.tar.gz"
+ "0001_dont_process_pdf_as_image.patch"
+)
noextract=()
-sha256sums=(36b6d8611c412ff930169aacb87c8263f61c10dbd163ebaeddb62f05652c4a60)
+sha256sums=('79574ceefe457eae5e9174577979871618c7cb32bbdd35cce234ff6219017432'
+ 'f0cea2431af21d7640c869856ce16609d340fe45c2c997e72123cea78febc454')
validpgpkeys=()
+prepare() {
+ cd "$_reponame-$_repover"
+ patch -N -p1 -i "${srcdir}/0001_dont_process_pdf_as_image.patch"
+}
+
build() {
cd "$_reponame-$_repover/$pkgname"
qmake $pkgname.pro -spec linux-g++ "CONFIG+=release"