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

Vimiv Metadata Keys #324

Open
jcjgraf opened this issue Jan 21, 2021 · 1 comment
Open

Vimiv Metadata Keys #324

jcjgraf opened this issue Jan 21, 2021 · 1 comment

Comments

@jcjgraf
Copy link
Contributor

jcjgraf commented Jan 21, 2021

As briefly mentioned in #321, it would be useful to to be able to display some information about the image file in the metadata widget, which are not part of exif (or only part for some formats). Concretely, it would be useful to be able to get the imageformat, X and Y dimension in pixels and the file size.

To integrate this information into the metadata widget, probably the easiest option would be to add some special keys, which are e.g. prefixed by Vimiv.<key>. In imutils.exif.ExifHandler we would have to filter these options before submitting the keys to exiv2 and handle them separately.

The advantage of this approach is that these additional information is well integrated into the metadata widget, meaning that no extra command or something is required to display them.

Open questions:

  • What keys would be useful to have? I have so far come up with:
    • Vimiv.ImageFormat: Image extension (JPEG, CR2 etc.)
    • Vimiv.XDimension: Length of image in pixels
    • Vimiv.YDimension: Height of image in pixels
    • Vimiv.FileSize: The file size in MB
  • Should imutils.exif.ExifHandler be renamed to imutils.metadata.MetadataHandler (or something similar) since the handler deals with exif, iptc and general metadata.

What do you think @karlch? Do you have a better idea for an implementation?

@karlch
Copy link
Owner

karlch commented Jan 21, 2021

I like the idea of having additional "internal" keys, but I am not sure I like mixing this with the ExifHandler directly. The code is already quite involved there. I am fine with renaming the handler though, as you say also iptc is supported.

Personally, I would prefer to have all of this split into different chunks, maybe something like:

  • The exif / metadata handler that we have currently to deal with regular keys
  • Some function / class / module to deal with vimiv keys
  • Some class that combines the two and delegates the work accordingly

Careful thinking would be especially important if the vimiv keys require accessing the current pixmap to retrieve the pixel size as I would really like to keep exif and qt pixmaps as separate as possible. The more I think about this the more afraid I am of possible code coupling, but I may be overthinking and should probably wait for some actual coding 😆

What do you think? Do you want to take a shot at this?

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