Visual indication "has destination coordinates" in file window?

Started by lbo, October 21, 2018, 06:19:37 PM

Previous topic - Next topic

lbo

Hi all,

how can I get a visual indication (flag) in the file window to show me whether a file has GPS destination coordinates?

The globe icon tells me that there are GPS coordinates, is there an equivalent for destination coordinates?

I need to add destination coordinates to my images, and since the targets are not in order, I jump back and forth between images. I need to see which images are already processed and which are yet to do.

Hiding images with destination coordinates (with a filter) is no option since I need to see them as a reference.

Oliver

Mario

Why don't you just show the destination coordinates in a file window layout?
Or maybe show a custom icon if the coordinates exist?

See this article in the IMatch knowledge-base: https://www.photools.com/3906/custom-icons-file-window/
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

lbo


lbo

should images be allowed in "hasvalue" sections? Maybe I did something wrong:

{File.MD.XMP::exif\GPSDestLatitude\GPSDestLatitude\0|hasvalue:YesDest;default:NoDest} works.

{File.MD.XMP::exif\GPSDestLatitude\GPSDestLatitude\0|hasvalue:YesDest;default:<Image Source='file://C:\temp\destination.png'></Image>} works, but I want the image if a value is set, not if it is missing.

{File.MD.XMP::exif\GPSDestLatitude\GPSDestLatitude\0|hasvalue:<Image Source='file://C:\temp\destination.png'></Image>;default:NoDest} instead of the image, the tag text is displayed.

Oliver

Mario

XAML is complicated as it is. Not everything is possible.
Did you copy/paste your variably in the VarToy App and checked the result?
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

lbo

I don't suspect the problem in XAML itself but in embedding it in the "hasvalue" part.

I can do more tests tomorrow when I'm in front of a bigger screen.

IIRC, the VarToy didn't print the <Image Source='file://C:\temp\destination.png'></Image> tag at all, therefore I did my tests with plain text and the image variant in the layout environment.

Oliver

Mario

IMatch does not attempt to make everything possible everywhere.
Think about things like escaping etc. See the Variables help topic.

Also I think the KB article shows how to show an icon or an alternative text.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Jingo

Not sure how helpful this is - but this is the code I use to display various "letters" to indicate whether an image has a certain value set or not... I know Markus uses a TON of icons to display his info.. so perhaps his code is more helpful than mine and he can share a bit of it to help you.  Good Luck!


<Run Foreground='{File.Relations|hasvalue:#FF8000;default:#555555}'>V</Run><Run Foreground='{File.MD.Composite\GPSPosition\GPSPosition\0|hasvalue:#FF8000;default:#555555}'> G</Run>  <Run Foreground='{File.Rating|numcomp:gt,0,#FF8000,#555555}'> R{File.Rating|numformat:float,1} </Run> <Run Foreground='{File.MD.hierarchicalkeywords|hasvalue:#FF8000;default:#555555}'>{File.MD.hierarchicalkeywords|hasvalue:K{File.MD.hierarchicalkeywords|count:true};default:K0}</Run>

sinus

Hey Jingo

You have a good memory.  ;D
Yep, I use quite a lot of variables in my windows layout.

But I have tried your variable and it works here fine, cool!
If someone must have more examples, simply ask for more.

And after all, like Mario wrote, there are also nice examples in the help and in the knowledge base.
Best wishes from Switzerland! :-)
Markus

lbo

Quote from: Mario on October 21, 2018, 08:38:49 PM
XAML is complicated as it is. Not everything is possible.

please read again the simple question I asked yesterday evening:

should images be allowed in "hasvalue" sections?

As I already showed, the method of the knowledge-base article you linked to (https://www.photools.com/3906/custom-icons-file-window/) does not work if I move the <image> tag from the "default" part to the "hasvalue" part.

But we don't even need an <image> tag to show the error, a simple <Bold> tag is sufficient:

This works:
{File.MD.XMP::exif\GPSDestLatitude\GPSDestLatitude\0|default:x<Bold>x</Bold>x}

This works not (tag source is output instead of bold formatting):
{File.MD.XMP::exif\GPSDestLatitude\GPSDestLatitude\0|hasvalue:x<Bold>x</Bold>x}

I think my example from yesterday evening was already well-prepared and stripped down but now it should be unmistakable. I consider this an error after sleeping on it.

Oliver

sinus

Quote from: lbo on October 22, 2018, 08:07:31 AM
Quote from: Mario on October 21, 2018, 08:38:49 PM
XAML is complicated as it is. Not everything is possible.

please read again the simple question I asked yesterday evening:

should images be allowed in "hasvalue" sections?

Oliver,
Variables are quite difficult, I think. Hence, if for me a variables once works, I use it simply.  ;D

With hasvalue I use for example this one:

{File.MD.XMP::photoshop\Headline\Headline\0|default:;hasvalue:privgel;pereplace:privgel==<Image Source='file://c:\sinus-icons\privgel20.png'/>}

Maybe you want try it? Of course change the image-path.

(you can change of course also the word privgel with x or so)
Best wishes from Switzerland! :-)
Markus

lbo

Jingo, Markus:

Thanks for the examples. Making part of the formatting (i.e. color) variable dependent is a clever method circumventing the problem I demonstrated. It doesn't seem to be possible with file names, though.

Quote from: sinus on October 22, 2018, 08:06:16 AMAnd after all, like Mario wrote, there are also nice examples in the help and in the knowledge base

It was exactly the example at https://www.photools.com/3906/custom-icons-file-window/ -> section "Use <Image> to Load Images" using tags inside a "default" formatting function of a variable.

Since "default" and "hasvalue" seem to be counterparts according to https://www.photools.com/help/imatch/#var_basics.htm and the KB article used a XAML tag in the default formatting, I see no reason why tags shouldn't also work in "hasvalue".

Oliver

sinus

Quote from: lbo on October 22, 2018, 08:34:55 AM
Jingo, Markus:
Since "default" and "hasvalue" seem to be counterparts according to https://www.photools.com/help/imatch/#var_basics.htm and the KB article used a XAML tag in the default formatting, I see no reason why tags shouldn't also work in "hasvalue".

Oliver

Maybe, I do not know about this, XAML and variables and so on are (for me) quite difficult.
If it works, it works, if not, I try another way.  ;D

And my last example, does it work for you?
Best wishes from Switzerland! :-)
Markus

lbo

Quote from: sinus on October 22, 2018, 08:33:03 AM
With hasvalue I use for example this one:

{File.MD.XMP::photoshop\Headline\Headline\0|default:;hasvalue:privgel;pereplace:privgel==<Image Source='file://c:\sinus-icons\privgel20.png'/>}

that's a nice workaround for the hasvalue error, and it works also in my case:
{File.MD.XMP::exif\GPSDestLatitude\GPSDestLatitude\0|default:;hasvalue:hasDest;pereplace:hasDest==<Image Source='file://C:\temp\hasDest20.png'/>}

So my current findings are:

  • "default" supports tags (even described in a KB article).
  • "hasvalue" does not support tags although it looks pretty similar to "default". I consider this surprising at least, but more likely being an error.
  • We can work around this by using a plain text placeholder and using pereplace to generate the tag.

Thanks also for demonstrating that the short form of an image tag is also possible in IMatch.

Oliver (from Munich)

Mario

As I said, not everything works everywhere. Variables are a great performance drag (people are using them in file window layouts!) and hence performance is usually much more important than handling every border case 1 user may come up with.

I would estimate that 0.1% of the IMatch user base does more with variables than picking them from the selector. Maybe some formatting here and there, to get a date right.
It works nicely as it is and I won't spend more time with this. Probably I do (have to do) a complete rewrite when I create a new product generation with other programming languages and platforms.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

lbo

Mario, I'm not sure whether I was able to describe the core issue (different behaviour of "default" and "hasvalue") clear enough to be understood by you.

Quote from: Mario on October 22, 2018, 09:28:06 AM
It works nicely as it is and I won't spend more time with this. Probably I do (have to do) a complete rewrite when I create a new product generation with other programming languages and platforms.

I disagree.

Since "default" and "hasvalue" seem to be so closely related, I suspect there is just a minor error in "hasvalue". Of course this doesn't require a complete rewrite but a comparison of both functions.

Based on this "default" and "hasvalue" similarity, I see also no "performance problem" or "border case".

Anyway, I strongly suggest you add a warning to the section "Use <Image> to Load Images" of https://www.photools.com/3906/custom-icons-file-window/ that <image> (or other tags) work only with "default" but not with "hasvalue".

Otherwise more users reading this KB article will waste time to find out that "hasvalue" doesn't support tags.

Oliver

Mario

Open a bug report. I can then spend time with this for one of the next releases.

QuoteOtherwise more users reading this KB article will waste time to find out that "hasvalue" doesn't support tags.

This article is over two years old, nobody ever complained. You are very likely the only user who will ever have use for this.

Is is a most likely a won't fix problem, since it is related to the already complex escaping problem with XAML in combination with variables.
Even spending time to reproduce this is probably wasted and better spent with features and enhancements which affect more than one user.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook