Custom icons for recent article added to IMatch Knowledge base

Started by Aubrey, June 21, 2015, 02:49:00 PM

Previous topic - Next topic

Aubrey

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.

Mario

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).
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Aubrey

Mario,
Thanks for the reply. I did wonder if that might be the case as I was writing the request.

Aubrey.

sinus

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.
Best wishes from Switzerland! :-)
Markus

sinus

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?
Best wishes from Switzerland! :-)
Markus

Mario

Check your syntax. I made a check, BMP files are supported.
And my samples from the KB article also work.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

sinus

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






Best wishes from Switzerland! :-)
Markus

Mario

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.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

sinus

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]
Best wishes from Switzerland! :-)
Markus

zematima

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.


Mario

We sh9uld not discuss the same isse here and in the bug report thread filed by another user. This is confusing.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Mario

{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.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

sinus

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]
Best wishes from Switzerland! :-)
Markus

Mario

Since this is related to an already solved bug report, I won't reply here but in the bug report.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

PandDLong

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

sinus

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!


Best wishes from Switzerland! :-)
Markus

Mario

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.

-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

PandDLong

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

Mario

Which version of IMatch do you use?
Because I get:



Maybe something 'fixed' in a later version or the IMatch 2021 prototype I'm using (the Markup processor is the same)?
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

PandDLong


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