GithubHelp home page GithubHelp logo

exiv2 0.28.0 support about geeqie HOT 12 CLOSED

0-wiz-0 avatar 0-wiz-0 commented on June 1, 2024
exiv2 0.28.0 support

from geeqie.

Comments (12)

neheb avatar neheb commented on June 1, 2024
--- a/src/exiv2.cc
+++ b/src/exiv2.cc
@@ -62,6 +62,11 @@

 #include "misc.h"

+#if EXIV2_TEST_VERSION(0,28,0)
+#define AnyError Error
+#define AutoPtr UniquePtr
+#endif
+
 typedef struct _AltKey AltKey;

 struct _AltKey
@@ -174,7 +179,7 @@ public:
        {
                cp_data_ = NULL;
                cp_length_ = 0;
-               image_ = image;
+               image_ = std::move(image);
                valid_ = TRUE;
        }

@@ -364,7 +369,11 @@ public:
                        Exiv2::Image *image = imageData_->image();

 #ifdef HAVE_EXIV2_ERROR_CODE
+#if EXIV2_TEST_VERSION(0,28,0)
+                       if (!image) throw Exiv2::Error(Exiv2::ErrorCode::kerInputDataReadFailed);
+#else
                        if (!image) throw Exiv2::Error(Exiv2::kerInputDataReadFailed);
+#endif
 #else
                        if (!image) throw Exiv2::Error(21);
 #endif
@@ -839,7 +848,11 @@ gint exif_item_get_integer(ExifItem *item, gint *value)
 {
        try {
                if (!item || exif_item_get_elements(item) == 0) return 0;
+#if EXIV2_TEST_VERSION(0,28,0)
+               *value = ((Exiv2::Metadatum *)item)->toInt64();
+#else
                *value = ((Exiv2::Metadatum *)item)->toLong();
+#endif
                return 1;
        }
        catch (Exiv2::AnyError& e) {
@@ -1224,10 +1237,17 @@ guchar *exif_get_preview(ExifData *exif, guint *data_len, gint requested_width,
                        Exiv2::PreviewImage image = pm.getPreviewImage(*pos);

                        Exiv2::DataBuf buf = image.copy();
+#if EXIV2_TEST_VERSION(0,28,0)
+                       *data_len = buf.size();
+                       auto b = buf.data();
+                       buf.reset();
+                       return b;
+#else
                        std::pair<Exiv2::byte*, long> p = buf.release();

                        *data_len = p.second;
                        return p.first;
+#endif
                        }
                return NULL;
        }

from geeqie.

caclark avatar caclark commented on June 1, 2024

Thanks for your help @neheb .
I cannot even get past the headers - I get:

/usr/local/include/exiv2/error.hpp:56:16: error: variable ‘Exiv2::EXIV2API Exiv2::LogMsg’ has initializer but incomplete type

and then everything fails...

I do not have a good feeling about this.

from geeqie.

xsdg avatar xsdg commented on June 1, 2024

I haven't taken a close look, but "initializer but incomplete type" means that the type is being used in a context where it needs to be fully defined, but the compiler doesn't see a full definition yet at that point.

This is a pure guess, but I'm guessing that error.hpp relies on a type that's defined in log.hpp or something, but doesn't actually #include that dependency, and it probably wasn't noticed because everywhere else that uses it also includes log.hpp first.

from geeqie.

xsdg avatar xsdg commented on June 1, 2024

(That is, just by the signature, this looks like an exiv2 bug)

from geeqie.

neheb avatar neheb commented on June 1, 2024

Weird.

mkdir subprojects
meson wrap install exiv2
meson setup --wrap_mode=forcefallback build
meson compile -C build

Should result in a successful build.

edit: this project looks like it needs some clang-tidy cleanups.

from geeqie.

caclark avatar caclark commented on June 1, 2024

Thanks @neheb . I can now compile the project. But....

With the exif window open and viewing a certain type of file there is a crash. It happens with NEF files from my camera, but not with NEF test images downloaded from the Internet.

Attached is the log file and a sample image. If anyone can easily see the problem, that is good. Otherwise it will take me a while (or longer) to find the problem.

log3.txt.gz
2019-12-23-11:21:44-DSC_3328.NEF.gz

from geeqie.

neheb avatar neheb commented on June 1, 2024

Sounds like an upstream issue

from geeqie.

caclark avatar caclark commented on June 1, 2024

Compilation is ok, but the seg. fault with some .nef files remains.

from geeqie.

neheb avatar neheb commented on June 1, 2024

Some nef files.

Probably should submit a bug report upstream.

from geeqie.

caclark avatar caclark commented on June 1, 2024

I have raised an issue at exiv2: Exiv2/exiv2#2638

If I knew anything about c++, things would be easier....

from geeqie.

neheb avatar neheb commented on June 1, 2024

since this project is C++ as well, probably should use clang-tidy.

from geeqie.

caclark avatar caclark commented on June 1, 2024

Fixed in commit c45cca7

from geeqie.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.