photools.com Community

IMatch Discussion Boards => General Discussion and Questions => Topic started by: Aubrey on June 21, 2015, 02:49:00 PM

Title: Custom icons for recent article added to IMatch Knowledge base
Post by: Aubrey on June 21, 2015, 02:49:00 PM
Mario added an interesting article earlier today to the IMatch knowledge base:
http://www.photools.com/3906/custom-icons-file-window

Is it possible for Mario to add these icons to the resources/bitmaps for the next release ? I like the choice of key and notepad.... perhaps in the interim they could be attached to a reply for interested users to download?

Thanks,
Aubrey.
Title: Re: Custom icons for recent article added to IMatch Knowledge base
Post by: Mario on June 21, 2015, 03:37:40 PM
These are licensed icons for which I paid money. I'm not permitted to offer them for download. I can only use them in my software.

But there are so many web sites out there where you can download icons for free (legally), I'm sure you find something you can use. Just give your favorite search engine a spin. Be aware of sites which only offer free downloads to spread viruses. Make sure the site is valid and safe before you download anything (true for all kinds of downloads, not just icons).
Title: Re: Custom icons for recent article added to IMatch Knowledge base
Post by: Aubrey on June 21, 2015, 03:43:41 PM
Mario,
Thanks for the reply. I did wonder if that might be the case as I was writing the request.

Aubrey.
Title: Re: Custom icons for recent article added to IMatch Knowledge base
Post by: sinus on June 22, 2015, 02:17:28 PM
Quote from: emef on June 22, 2015, 01:23:09 PM
Hello everyone,
I followed the examples set by Mario, and of course, I got an icon in "png", I resized to 32x32 pixels. Not having, on my machine, path like to "<Image Source = 'file: // c: \ data \ imdb \ nokeywords.png'> </ Image>" I placed the icon in "c: \ ProgramData \ photools.com \ IMatch5 \ data \ icons \ Nokeyword.png "and altered the path accordingly, ie d. "<Image Source = 'file: // c: \ ProgramData \ photools.com \ IMatch5 \ data \ icons \ Nokeyword.png'> </ Image>" ... Alas, this is not working. I certainly missed something?   ???

Hi emef

For me such a path works:
<Image Source='file://c:\sinus-icons\meta24.png'/>}

In your exampe you have spaces, is this only to show here better?
It should be, I guess:

<Image Source = 'file://c:\ProgramData\photools.com\IMatch5\data\icons\Nokeyword.png/>}

Then let me add, if you installes a new IMatch-version, MAYBE your images goes lost.
That is why I took, to be sure, a completely different folder.
Hope this helps.
Title: Re: Custom icons for recent article added to IMatch Knowledge base
Post by: sinus on June 22, 2015, 03:48:00 PM
And do you get a "cross" instead of the icon or do you get nothing?

You have wrote Nokeyword.png with a big N - is this correct?
Title: Re: Custom icons for recent article added to IMatch Knowledge base
Post by: Mario on June 22, 2015, 05:36:26 PM
Check your syntax. I made a check, BMP files are supported.
And my samples from the KB article also work.
Title: Re: Custom icons for recent article added to IMatch Knowledge base
Post by: sinus on June 22, 2015, 06:20:47 PM
Quote from: Mario on June 22, 2015, 05:36:26 PM
Check your syntax. I made a check, BMP files are supported.
And my samples from the KB article also work.

As I wrote in the German thread of Hans-Wolfgang, https://www.photools.com/community/index.php?topic=4640.0
bmp works here also.

Then, if I copy the variable from the Knowledge Base, then the code works not.
The reason, at least for me, is, that the appostrophs are wrong.

This line here works for me:
{File.MD.hierarchicalkeywords|hasvalue:;default:<Image Source='file://c:\sinus-icons\meta20.png'/>}

while this code from the KB works not for me:
{File.MD.hierarchicalkeywords|hasvalue:;default:<Image Source='file://C:\data\imdb\icons\nokeywords.png'></Image>}

The apostrophs are (for me) wrong and if I enter at the end of MY code this here </Image> then it works also not
For me only my line works correct.

Hope, this helps.
Markus






Title: Re: Custom icons for recent article added to IMatch Knowledge base
Post by: Mario on June 22, 2015, 06:33:47 PM
You copy what from where?
I also copied the code from the KB article into my layout, and it works like a charm.
Please give more details.
Title: Re: Custom icons for recent article added to IMatch Knowledge base
Post by: sinus on June 22, 2015, 06:41:59 PM
Quote from: Mario on June 22, 2015, 06:33:47 PM
You copy what from where?
I also copied the code from the KB article into my layout, and it works like a charm.
Please give more details.

I copied directly from the Knowledebase, from here, see attachements, into the Layout Editor.

Then, in the Layout Editor, if I replace these

{File.MD.hierarchicalkeywords|hasvalue:;default:<Image Source='file://C:\data\imdb\icons\nokeywords.png'></Image>}

(also this line above is copied directly from the KB)

with other apostrophs,
{File.MD.hierarchicalkeywords|hasvalue:;default:<Image Source='file://C:\data\imdb\icons\nokeywords.png'></Image>}

it works still not for me. But if I then delete the </Image>, it works perfectly.


Note, that HERE, in the browser NOW, the apostrophs appears equal, but in the layout Editior AND in this box from the forum, where I write this here (before I send it), the apostrophs appears different.

In Word they appearas also equal.


[attachment deleted by admin]
Title: Re: Custom icons for recent article added to IMatch Knowledge base
Post by: zematima on June 22, 2015, 06:46:25 PM
Hi:
I think what sinus means is:
If you copy the code from here :
http://www.photools.com/3906/custom-icons-file-window/
It doesn't work
The code is this: (I only changed the file name to jr
{File.MD.hierarchicalkeywords|hasvalue:;default:<Image Source='file://C:\data\imdb\icons\jr.png'></Image>}

Instead if you use sinus code:
{File.MD.hierarchicalkeywords|hasvalue:;default:<Image Source='file://d:\Backups\jr.png'/>}
It works.
At least for me either.
PS :
If I use the bmp file it also works.

Title: Re: Custom icons for recent article added to IMatch Knowledge base
Post by: Mario on June 22, 2015, 06:47:06 PM
We sh9uld not discuss the same isse here and in the bug report thread filed by another user. This is confusing.
Title: Re: Custom icons for recent article added to IMatch Knowledge base
Post by: Mario on June 22, 2015, 06:47:53 PM
{File.MD.hierarchicalkeywords|hasvalue:;default:<Image Source="file://C:\data\imdb\icons\banana.png"></Image>}
{File.MD.hierarchicalkeywords|hasvalue:;default:<Image Source='file://C:\data\imdb\icons\banana.png'></Image>}

Works for me.

Where do you place the code, are there other cells filled, if so with what etc.
Export your layout and attach so I can see what you are doing.
Or attach to the bug report, better. Discussing the same stuff in multiple threads makes things harder for everybody.
Title: Re: Custom icons for recent article added to IMatch Knowledge base
Post by: sinus on June 22, 2015, 07:06:57 PM
I think, the problem are the apostrophs in the KB.

Here the layout is attached.
If I have both footers, it works not.

If I delete the second footer, it works.

Sorry, I have changed the extension from the upload to txt, simply change again to imfwl.

And sorry, I have to go now ... ???

[attachment deleted by admin]
Title: Re: Custom icons for recent article added to IMatch Knowledge base
Post by: Mario on June 22, 2015, 07:07:37 PM
Since this is related to an already solved bug report, I won't reply here but in the bug report.
Title: Re: Custom icons for recent article added to IMatch Knowledge base
Post by: PandDLong on April 15, 2021, 11:38:37 PM
Quote from: sinus on June 22, 2015, 06:20:47 PM

Then, if I copy the variable from the Knowledge Base, then the code works not.
The reason, at least for me, is, that the appostrophs are wrong.

This line here works for me:
{File.MD.hierarchicalkeywords|hasvalue:;default:<Image Source='file://c:\sinus-icons\meta20.png'/>}

while this code from the KB works not for me:
{File.MD.hierarchicalkeywords|hasvalue:;default:<Image Source='file://C:\data\imdb\icons\nokeywords.png'></Image>}

The apostrophs are (for me) wrong and if I enter at the end of MY code this here </Image> then it works also not
For me only my line works correct.

Hope, this helps.
Markus

I wanted to thank Markus for posting this - even though this was many years ago.   I am a new user but ran into exactly this problem where cutting and pasting from the KB didn't work.  In fact, I had this code in the my second footer and whenever there were no keywords all information in all footers disappeared - like trying to display the image created a blackout affect.    I almost went cross-eyed trying to identify where my cut and paste (and different file path) had gone wrong.


This forum has some timeless and useful information.  Thanks for having it.

I suggest adding a small note in the KB article that for some users the code needs to have the ending a bit different.

Michael
Title: Re: Custom icons for recent article added to IMatch Knowledge base
Post by: sinus on April 16, 2021, 07:25:03 AM
Quote from: PandDLong on April 15, 2021, 11:38:37 PM
...
I wanted to thank Markus for posting this - even though this was many years ago.   I am a new user but ran into exactly this problem where cutting and pasting from the KB didn't work.  In fact, I had this code in the my second footer and whenever there were no keywords all information in all footers disappeared - like trying to display the image created a blackout affect.    I almost went cross-eyed trying to identify where my cut and paste (and different file path) had gone wrong.
...
Michael

Thanks, Michael
Very nice of you!  :)
Cool, that even an old post could help you!


Title: Re: Custom icons for recent article added to IMatch Knowledge base
Post by: Mario on April 16, 2021, 01:43:02 PM
I've tried

{File.MD.hierarchicalkeywords|hasvalue:;default:<Image Source='file://C:\data\imdb\icons\banana.png'></Image>}

{File.MD.hierarchicalkeywords|hasvalue:;default:<Image Source='file://C:\data\imdb\icons\banana.png'/>}

and both work. Either /> or </Image> can be used.

Do I miss something? What exactly is the error you see?

Tip: Copy the variable into the File Window Info Tip (Edit > Preferences > File Window Tip) to see the error message returned by the XAML parser.

Title: Re: Custom icons for recent article added to IMatch Knowledge base
Post by: PandDLong on April 16, 2021, 09:40:50 PM
In the File Window Tip - your first example gives the error <<XML Error (0xC00CE56D) 'End tag image' does not match the start tag 'image'.'at 1:2033'<Page >>  and then many lines of information.

The second example gives no error (it also doesn't put the icon into the Test Tip but I expect that is a different matter).

Michael
Title: Re: Custom icons for recent article added to IMatch Knowledge base
Post by: Mario on April 17, 2021, 08:37:03 AM
Which version of IMatch do you use?
Because I get:

(https://www.photools.com/community/index.php?action=dlattach;topic=4638.0;attach=26895;image)

Maybe something 'fixed' in a later version or the IMatch 2021 prototype I'm using (the Markup processor is the same)?
Title: Re: Custom icons for recent article added to IMatch Knowledge base
Post by: PandDLong on April 26, 2021, 06:38:49 AM

So this is the stuff that can drive developers crazy....

I am using the latest iMatch 2020 version and have check for updates turned on.

Mine now works like your example - both syntax choices produce the icon - no longer any error in the File Window Test tip.

The only change I can think of between then and now is some Microsoft Windows updates.    I don't believe there has been any iMatch updates in April.

I also noticed that in the KB article in the final example (with the use of the pereplace function) the "shorter" version is used.   I guess both syntax should always work but in some cases only one of the version works.   Strange stuff.

I am glad I got it to work - I have an icon rich QA File Window Layout which is proving a fast way to do a final QA check on a batch of files.

Michael