Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Files without Exif data aren't handled correctly #1

Closed
lizmat opened this issue Sep 28, 2024 · 7 comments
Closed

Files without Exif data aren't handled correctly #1

lizmat opened this issue Sep 28, 2024 · 7 comments

Comments

@lizmat
Copy link
Contributor

lizmat commented Sep 28, 2024

The example programs, and all other code I tried, failed with:

Cannot look up attributes in a Image::Libexif::Raw::ExifData type object. Did you forget a '.new'?
  in method ifd at ...site/sources/5CB626BF4325F87DF784D52D1212BBF6717E278F (Image::Libexif::Raw) line 32
  in method info at .../site/sources/8AD5D6371908A829FC5D323173190AD2C75517DC (Image::Libexif) line 173

Is there something I'm missing?

@frithnanth
Copy link
Owner

That's odd: line 32 of Image::Libexif::Raw::ExifData is the declaration of a CStruct. The only thing that might seem different from the usual is that that class has an "embedded" attribute declared with HAS instead of has, but it sounds strange that Linux and MacOS behaved differently on that.

Maybe you have a different version of libexif? Here on a Linux Debian installation I have libexif v0.6.24 and everything works fine.

@lizmat
Copy link
Contributor Author

lizmat commented Sep 30, 2024

The version of libexif is the same.

I also tried this on a MacOS with an Intel processor: there it works. So it appears to be an Apple Silicon related issue :-(

@frithnanth
Copy link
Owner

A hardware problem? :-o That's very unfortunate!
Might it be a problem related to NativeCall on that specific platform? (not that I'm able to help in that case…)

@lizmat
Copy link
Contributor Author

lizmat commented Sep 30, 2024

Possibly: I'll investigate further after the weekly.

Reason for me is to be able to add searching in EXIF information to App::Rak.

lizmat added a commit to lizmat/Image-Libexif that referenced this issue Sep 30, 2024
It appears that some files don't actually contain any exif data.
Creating an object with such a file would put a type object into
the $!exif attribute, causing later havoc.

This commit ensures that that is at least a bare ExifData object
created when loading a file that doesn't contain any exif data.

An example of such a file is:

   nqp/MoarVM/3rdparty/libuv/docs/src/static/architecture.png

in any Rakudo installation.

Fixes issue frithnanth#1
@lizmat lizmat changed the title Cannot get it to work on MacOS Files without Exif data aren't handled correctly Sep 30, 2024
@lizmat
Copy link
Contributor Author

lizmat commented Sep 30, 2024

Before I can add exif searching to App::Rak, I would need to add possibly quite a few convenience methods. Also I noticed that quite a few tagnames are missing, at least from the few files I tried (e.g. 0x0003/04/05/06/10/17/1f).

So my questions: would you prefer me to create a wrapper module (e.g. Image::Info) with Image::Libexif as a dependency. Or would you rather I add these methods to Image::Libexif itself?

Also: would you consider me taking over support / development of this module? ( my fingers are itching :-)

@frithnanth
Copy link
Owner

It works for me both ways, with a slight preference for a wrapper module.
A wrapper module might add features not covered by libexif, add other dependencies, or switch to a different library altogether transparently towards dependent modules.

@lizmat
Copy link
Contributor Author

lizmat commented Sep 30, 2024

Ok, I will target an Image::Info module then :-)

@lizmat lizmat closed this as completed Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants