Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 906469
Collapse All | Expand All

(-)a/DB/FileInfo.cpp (-1 / +10 lines)
Lines 1-5 Link Here
1
// SPDX-FileCopyrightText: 2003-2010 Jesper K. Pedersen <blackie@kde.org>
1
// SPDX-FileCopyrightText: 2003-2010 Jesper K. Pedersen <blackie@kde.org>
2
// SPDX-FileCopyrightText: 2021 Johannes Zarl-Zierl <johannes@zarl-zierl.at>
2
// SPDX-FileCopyrightText: 2021 Johannes Zarl-Zierl <johannes@zarl-zierl.at>
3
// SPDX-FileCopyrightText: 2023 Tobias Leupold <tl at stonemx dot de>
3
//
4
//
4
// SPDX-License-Identifier: GPL-2.0-or-later
5
// SPDX-License-Identifier: GPL-2.0-or-later
5
6
Lines 13-18 Link Here
13
#include <QFileInfo>
14
#include <QFileInfo>
14
#include <QRegularExpression>
15
#include <QRegularExpression>
15
16
17
#include <exiv2/version.hpp>
18
16
using namespace DB;
19
using namespace DB;
17
20
18
FileInfo FileInfo::read(const DB::FileName &fileName, DB::ExifMode mode)
21
FileInfo FileInfo::read(const DB::FileName &fileName, DB::ExifMode mode)
Lines 79-86 void DB::FileInfo::parseEXIV2(const DB::FileName &fileName) Link Here
79
        const Exiv2::Exifdatum &datum = m_exifMap["Exif.Image.Orientation"];
82
        const Exiv2::Exifdatum &datum = m_exifMap["Exif.Image.Orientation"];
80
83
81
        int orientation = 0;
84
        int orientation = 0;
82
        if (datum.count() > 0)
85
        if (datum.count() > 0) {
86
#if EXIV2_TEST_VERSION(0, 28, 0)
87
            orientation = datum.toInt64();
88
#else
83
            orientation = datum.toLong();
89
            orientation = datum.toLong();
90
#endif
91
        }
92
84
        m_angle = orientationToAngle(orientation);
93
        m_angle = orientationToAngle(orientation);
85
    }
94
    }
86
95
(-)a/lib/kpaexif/Database.cpp (-4 / +4 lines)
Lines 1-6 Link Here
1
// SPDX-FileCopyrightText: 2003-2020 The KPhotoAlbum Development Team
1
// SPDX-FileCopyrightText: 2003-2020 The KPhotoAlbum Development Team
2
// SPDX-FileCopyrightText: 2021 Johannes Zarl-Zierl <johannes@zarl-zierl.at>
2
// SPDX-FileCopyrightText: 2021-2022 Johannes Zarl-Zierl <johannes@zarl-zierl.at>
3
// SPDX-FileCopyrightText: 2022 Johannes Zarl-Zierl <johannes@zarl-zierl.at>
3
// SPDX-FileCopyrightText: 2023 Tobias Leupold <tl at stonemx dot de>
4
//
4
//
5
// SPDX-License-Identifier: GPL-2.0-or-later
5
// SPDX-License-Identifier: GPL-2.0-or-later
6
6
Lines 320-326 bool Exif::Database::add(const DB::FileName &fileName) Link Here
320
        return false;
320
        return false;
321
321
322
    try {
322
    try {
323
        Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(fileName.absolute().toLocal8Bit().data());
323
        const auto image = Exiv2::ImageFactory::open(fileName.absolute().toLocal8Bit().data());
324
        Q_ASSERT(image.get() != nullptr);
324
        Q_ASSERT(image.get() != nullptr);
325
        image->readMetadata();
325
        image->readMetadata();
326
        Exiv2::ExifData &exifData = image->exifData();
326
        Exiv2::ExifData &exifData = image->exifData();
Lines 341-347 bool Exif::Database::add(const DB::FileNameList &list) Link Here
341
341
342
    for (const DB::FileName &fileName : list) {
342
    for (const DB::FileName &fileName : list) {
343
        try {
343
        try {
344
            Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(fileName.absolute().toLocal8Bit().data());
344
            const auto image = Exiv2::ImageFactory::open(fileName.absolute().toLocal8Bit().data());
345
            Q_ASSERT(image.get() != nullptr);
345
            Q_ASSERT(image.get() != nullptr);
346
            image->readMetadata();
346
            image->readMetadata();
347
            map << DBExifInfo(fileName, image->exifData());
347
            map << DBExifInfo(fileName, image->exifData());
(-)a/lib/kpaexif/DatabaseElement.cpp (-7 / +14 lines)
Lines 1-13 Link Here
1
/* SPDX-FileCopyrightText: 2003-2010 Jesper K. Pedersen <blackie@kde.org>
1
// SPDX-FileCopyrightText: 2003-2010 Jesper K. Pedersen <blackie@kde.org>
2
// SPDX-FileCopyrightText: 2023 Tobias Leupold <tl at stonemx dot de>
3
//
4
// SPDX-License-Identifier: GPL-2.0-or-later
2
5
3
   SPDX-License-Identifier: GPL-2.0-or-later
4
*/
5
#include "DatabaseElement.h"
6
#include "DatabaseElement.h"
6
7
7
#include <kpabase/Logging.h>
8
#include <kpabase/Logging.h>
8
9
9
#include <QVariant>
10
#include <QVariant>
10
#include <exiv2/exif.hpp>
11
#include <exiv2/exif.hpp>
12
#include <exiv2/version.hpp>
11
13
12
static QString replaceDotWithUnderscore(const char *cstr)
14
static QString replaceDotWithUnderscore(const char *cstr)
13
{
15
{
Lines 76-85 QString Exif::IntExifElement::queryString() const Link Here
76
78
77
QVariant Exif::IntExifElement::valueFromExif(Exiv2::ExifData &data) const
79
QVariant Exif::IntExifElement::valueFromExif(Exiv2::ExifData &data) const
78
{
80
{
79
    if (data[m_tag].count() > 0)
81
    if (data[m_tag].count() > 0) {
80
        return QVariant { (int)data[m_tag].toLong() };
82
#if EXIV2_TEST_VERSION(0, 28, 0)
81
    else
83
        return QVariant((int) data[m_tag].toInt64());
82
        return QVariant { (int)0 };
84
#else
85
        return QVariant((int) data[m_tag].toLong());
86
#endif
87
    } else {
88
        return QVariant(0);
89
    }
83
}
90
}
84
91
85
Exif::RationalExifElement::RationalExifElement(const char *tag)
92
Exif::RationalExifElement::RationalExifElement(const char *tag)
(-)a/lib/kpaexif/Info.cpp (-3 / +3 lines)
Lines 1-5 Link Here
1
// SPDX-FileCopyrightText: 2003-2020 The KPhotoAlbum Development Team
1
// SPDX-FileCopyrightText: 2003-2020 The KPhotoAlbum Development Team
2
// SPDX-FileCopyrightText: 2021 Johannes Zarl-Zierl <johannes@zarl-zierl.at>
2
// SPDX-FileCopyrightText: 2021 Johannes Zarl-Zierl <johannes@zarl-zierl.at>
3
// SPDX-FileCopyrightText: 2023 Tobias Leupold <tl at stonemx dot de>
3
//
4
//
4
// SPDX-License-Identifier: GPL-2.0-or-later
5
// SPDX-License-Identifier: GPL-2.0-or-later
5
6
Lines 16-22 Link Here
16
#include <QTextCodec>
17
#include <QTextCodec>
17
#include <exiv2/exv_conf.h>
18
#include <exiv2/exv_conf.h>
18
#include <exiv2/image.hpp>
19
#include <exiv2/image.hpp>
19
#include <exiv2/version.hpp>
20
20
21
using namespace Exif;
21
using namespace Exif;
22
22
Lines 166-172 Info::Info() Link Here
166
void Exif::writeExifInfoToFile(const DB::FileName &srcName, const QString &destName, const QString &imageDescription)
166
void Exif::writeExifInfoToFile(const DB::FileName &srcName, const QString &destName, const QString &imageDescription)
167
{
167
{
168
    // Load Exif from source image
168
    // Load Exif from source image
169
    Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(QFile::encodeName(srcName.absolute()).data());
169
    auto image = Exiv2::ImageFactory::open(QFile::encodeName(srcName.absolute()).data());
170
    image->readMetadata();
170
    image->readMetadata();
171
    Exiv2::ExifData data = image->exifData();
171
    Exiv2::ExifData data = image->exifData();
172
172
Lines 201-207 Exif::Metadata Exif::Info::metadata(const DB::FileName &fileName) Link Here
201
{
201
{
202
    try {
202
    try {
203
        Exif::Metadata result;
203
        Exif::Metadata result;
204
        Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(QFile::encodeName(fileName.absolute()).data());
204
        auto image = Exiv2::ImageFactory::open(QFile::encodeName(fileName.absolute()).data());
205
        Q_ASSERT(image.get() != nullptr);
205
        Q_ASSERT(image.get() != nullptr);
206
        image->readMetadata();
206
        image->readMetadata();
207
        result.exif = image->exifData();
207
        result.exif = image->exifData();

Return to bug 906469