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

Limited metadata info #477

Open
mamadoumakalou opened this issue Mar 30, 2022 · 7 comments
Open

Limited metadata info #477

mamadoumakalou opened this issue Mar 30, 2022 · 7 comments

Comments

@mamadoumakalou
Copy link

Sorry if this is too obscure, but it's helpful for me to see color temp when reviewing photo metadata. This doesn't appear to be an option. I know the camera provides it as I can extract this info using the exiftool command, but pyexiv2 doesn't seem to provide access to this tag, or at least, that's not apparent using :metadata. Is there a way to add access to this tag? If not, how about a way to display output from a linux command on the photo, much in the same way the metadata info displays (as a widget?, not sure if this is the term being used). Many thanks, I've used many photo-viewing tools and this is by far the best.

@jcjgraf
Copy link
Contributor

jcjgraf commented Mar 30, 2022

Hey @mamadoumakalou, good to hear that you like vimiv and great to see other people caring about metadata. This shows us that, even though rather troublesome, trying to improve the metadata system is really worth it.

I would assume that by using pyexiv2 you should be able to extract all information exiv2 can extract. But having encountered already lots of troubles with pyexiv2, I would not be surprised if that is not the case.

Anyways, have you tried :metadata-list-keys? This command lists all keys available for a given image. Once you have figured out the key you are looking for, you can customize the metadata keysets.

Also, according to the exiv2 wiki, there should be a key Exif.Canon.ColorTemperature. But in my images it is called Exif.CanonPr.ColorTemperature. So, be aware of such discrepancies.

I hope that helps. If not, let me know

@mamadoumakalou
Copy link
Author

mamadoumakalou commented Mar 31, 2022

Thanks for the quick reply, @jcjgraf. Good questions, and I appreciate your awareness that pyexiv2/exiv2 is a work in progress.

Yes, I've thoroughly searched and tested :metadata-list-keys to no avail re color temperature for my camera make (Fuji). It's helpful to know that it seems to work for Canon. I hadn't found the exiv2 wiki, so that is helpful as well. On the wiki, I see that exiv2 doesn't use/find/read the tag for color temp. However, I know that Fuji does provide this metadata. I can easily see it using:

exiftool -H DSCF4477.JPG | grep Temp

The output for a particular image is:

0x1005 Color Temperature : 5000

The -H flag for exiftool includes the hex code for that tag, and I see in the exiv2 wiki for Fuji that this tag (0x1005) is not used. This is the root of my particular problem. The question, to my mind, is why doen't exiv2 use this tag given that Fuji makes it available.

Perhaps the next step is for me to open this issue with exiv2, which I may do. But I would also like to open the possibility here that vimiv might become more robust if users could, as I mentioned in the original issue, output any info they need to a widget that overlays the image, much like the metadata widget does. I have seen this work well on other programs, namely, feh. Perhaps there's a reason to avoid this? If so, that's a development choice that is completely understandable. But, it would be a solution or workaround for those experience the limitations of exiv2, or for that matter other tools.

Again, much thanks for your time and consideration.

@jcjgraf
Copy link
Contributor

jcjgraf commented Mar 31, 2022

Upstream exiv2 is very kind and helpful, they can certainly help you out.

Vimiv's metadata system is far from perfect. So, any feedback is very welcome. I have also considered moving the metadata system out to plugin-space, so that everyone can extract image metadata in whatever way that works for them (#467).

You can run any shell command from within vimiv (e.g. :!exiftool -H % | grep Temp, where % gets replaced by the name of the current image). Since stdout is currently not displayed in vimiv, I have added such an option in #478. Do you mind testing it and give feedback?

@mamadoumakalou
Copy link
Author

mamadoumakalou commented Apr 1, 2022

I like the idea of moving metadata to plugin space. I hadn't seen #467, thank you.

I have had issues with running shell commands in vimiv. For example, if I run the same code you mention above, :!exiftool -H % | grep Temp, everything after % is parsed as a file. If I quote the whole command !"exiftool -H % | grep Temp" I get back: command not found or not executable. The only thing that doesn't appear to exit with errors is simply !exiftool %, but that is not useful because the command runs and exits without visibly appearing anywhere. Have you had luck running command-line utils with !? I have had some successes too, !gimp works just fine, as does !xterm -e "exiftool -H % | grep Temp ; read"

I share all this in case it is useful. Now, regarding #478, thank you for working on this option. I am new to git, and as such have only used binary packages thus far. I used yay to install the git package. Is that an okay way to get the latest updates? It seems to have installed vimiv-qt-git-r2268.4a1a0d18-1 correctly.

I maybe be confused about where to "append" >, but I tried various iterations:

exiftool %>, returns: Error: File not found - /josh/pics/all/2021-/fuji/22-03-28_19-14-00.jpg> (parses > as part of filename)
exiftool % >, returns: Error: File not found - > (parses > as a separate filename)
!xterm -e "exiftool -H % | grep Temp ; read" >, returns no error, the image reloads, but nothing happens.

I tried a lot of other things too, including quoting differently, but these seem representative.

I would not be surprised if this is due to my lack of experience with install git packages, or even how to properly quote commands. I apologize if this is the case.

Please let me know what else I can test, etc. Also, as I am new to github, please let me know if I should split this email and add the content related to #478 to that issue, instead of here.

@jcjgraf
Copy link
Contributor

jcjgraf commented Apr 1, 2022

I have had issues with running shell commands in vimiv.

You are right, my proposed command is indeed not working. It appears that the pipe is not interpreted as a pipe but rather as a normal character (or as a filename in this case). I should have tested my commands before posting them here; sorry for that 😬

I need to have a look at the code and see what I can do

I used yay to install the git package

When using the git package from the AUR, you are running the vimiv version which is currently in the master branch. But you want to run the version which is in my PRs (Pull Request) branch.

So what you want to do instead:

  1. git clone https://github.com/karlch/vimiv-qt.git
  2. cd vimiv-qt
  3. git fetch origin refs/pull/478/head:feature/commandToStdout
  4. git checkout feature/commandToStdout
  5. tox -e mkvenv
  6. .venv/bin/vimiv

This pulls the latest version of vimiv from github, switches to the right branch, and runs vimiv from there.

Then you should be able to run something like :! exiftool -H % > and get (lots) of output (the output is not (yet) scrollable or something, but at least there is something so see).

let me know if I should split this email and add the content related to #478 to that issue, instead of here.

If you have direct feedback for #478, you can directly comment in there. But since this issue is already about many other things that just metadata, we can also keep the discussion in here

Anyways, I will have a look at he code in the next few days (hopefully) and see what I can do concerning pipes.

@mamadoumakalou
Copy link
Author

mamadoumakalou commented Apr 1, 2022

Thanks, @jcjgraf, for walking me through switching from the master to your branch. Should have thought of that.

I was able to test and see your option working! I used exiftool -@ /path/to/taglist % > to narrow which tags are printed to stdout. Looks good! I have already bound a key to this function.

The ability to use pipes and scroll output would be nice, but there are ways to get around these issues at least in many cases. One key feature would be that the output does something similar to the current metadata output, where it takes up minimal screen space, and, (possibly, though this is more involved and less necessary) stays on screen and re-runs the command.

@jcjgraf
Copy link
Contributor

jcjgraf commented Apr 2, 2022

Thanks for the feedback.

One key feature would be that the output does something similar to the current metadata output [..], and [..] stays on screen and re-runs the command.

I can see its potential. But I think that is something which is better implemented as a plugin.

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