* Plugin: Check for Unlinked Media

For users to report plugin bugs and request plugin enhancements; and for authors to test new/new versions of plugins, and to discuss plugin development (in the Programming Technicalities sub-forum). If you want advice on choosing or using a plugin, please ask in General Usage or an appropriate sub-forum.
Post Reply
User avatar
gerrynuk
Megastar
Posts: 565
Joined: 25 Apr 2007 09:21
Family Historian: V6
Location: Welwyn Garden City
Contact:

Plugin: Check for Unlinked Media

Post by gerrynuk » 15 Apr 2013 20:36

I have added a note to the page for this plugin on the Family Historian site asking if it is possible to amend the plugin to exclude the folders created by Picasa. At the moment all the Picasa thumbnails show up as unlinked media, which completely swamps the actual unlinked media.

Would anyone else find this useful?

ID:6898

User avatar
gerrynuk
Megastar
Posts: 565
Joined: 25 Apr 2007 09:21
Family Historian: V6
Location: Welwyn Garden City
Contact:

Plugin: Check for Unlinked Media

Post by gerrynuk » 13 May 2013 16:36

I wonder if some kind person who is familiar with Lua programming could advise me how I could amend Jane's excellent plugin. I would like the search to exclude any folders called '.picasaoriginals' but don't know what code to use or where to put it!

User avatar
Jane
Site Admin
Posts: 8442
Joined: 01 Nov 2002 15:00
Family Historian: V7
Location: Somerset, England
Contact:

Plugin: Check for Unlinked Media

Post by Jane » 13 May 2013 16:54

Do you know what version of Picasa creates those folders, I have it installed and don't have any folders with that name.

edit: To answer my own question, a google search shows it's where Picassa stores old copies of files you have edited. So you might actually be better to move the folders out of the project or just delete them.
Jane
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."

User avatar
gerrynuk
Megastar
Posts: 565
Joined: 25 Apr 2007 09:21
Family Historian: V6
Location: Welwyn Garden City
Contact:

Plugin: Check for Unlinked Media

Post by gerrynuk » 13 May 2013 17:49

I am using Version 3.9.16.37 for Mac.

Having carried out a little experimentation it appears that this version of Picasa will always create a folder called '.picasaoringinals' within the folder holding the image being edited. (I renamed the original folder but Picasa just created a new folder.) This means that there is an additional Picasa thumbnail for every edited image stored in an otherwise hidden folder. Your plugin indexes all these thumbnails and swamps the output with all the thumbnails which are not, of course, linked to FH.

User avatar
tatewise
Megastar
Posts: 27088
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Plugin: Check for Unlinked Media

Post by tatewise » 13 May 2013 23:02

Sorry to jump into this thread, but Gerry you could try the following edit to the Plugin.

Change the function buildfilelist() that starts on line 79.
Change line 86 if attr.mode == 'file' then as follows:

           if attr.mode == 'file' and not filename:match('picasaoriginals\') then

This should exclude any file paths with folder names that end with 'picasaoriginals'.

[EDIT] Line numbers corrected!
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
gerrynuk
Megastar
Posts: 565
Joined: 25 Apr 2007 09:21
Family Historian: V6
Location: Welwyn Garden City
Contact:

Plugin: Check for Unlinked Media

Post by gerrynuk » 14 May 2013 08:10

Thank you very much, Tatewise, that works a treat.

Just one small point, the relevant code is on line 86 in my version which is v1.7

User avatar
johnmorrisoniom
Megastar
Posts: 882
Joined: 18 Dec 2008 07:40
Family Historian: V7
Location: Isle of Man

Plugin: Check for Unlinked Media

Post by johnmorrisoniom » 14 May 2013 09:21

As an aside to this. I always edit my media in a separate location to my projects, before copying them into a project.

If you work this way with picassa, you will not get the problem with the thumbnails in your project (which also increase the size of what's in the folders).

User avatar
gerrynuk
Megastar
Posts: 565
Joined: 25 Apr 2007 09:21
Family Historian: V6
Location: Welwyn Garden City
Contact:

Plugin: Check for Unlinked Media

Post by gerrynuk » 14 May 2013 15:00

johnmorrisoniom said:
As an aside to this. I always edit my media in a separate location to my projects, before copying them into a project.

If you work this way with picassa, you will not get the problem with the thumbnails in your project (which also increase the size of what's in the folders).
Thanks for the tip. I just find it easier to put the images straight into the project and edit them before (or after) I link them to FH. It also means it is easy to check - using Jane's plugin - which images I have still to link. If the images were not in the project that option wouldn't be available without further amending the plugin.

User avatar
gerrynuk
Megastar
Posts: 565
Joined: 25 Apr 2007 09:21
Family Historian: V6
Location: Welwyn Garden City
Contact:

Re: Plugin: Check for Unlinked Media

Post by gerrynuk » 21 Dec 2014 10:43

tatewise wrote:Sorry to jump into this thread, but Gerry you could try the following edit to the Plugin.

Change the function buildfilelist() that starts on line 79.
Change line 86 if attr.mode == 'file' then as follows:

           if attr.mode == 'file' and not filename:match('picasaoriginals\') then

This should exclude any file paths with folder names that end with 'picasaoriginals'.

[EDIT] Line numbers corrected!
This modification was woking but having made the change to V1.7 of the plugin and tried to run it in FH Version 6 I am getting the following error message.
Screen Shot 2014-12-21 at 10.41.30.png
Screen Shot 2014-12-21 at 10.41.30.png (19.82 KiB) Viewed 6484 times

User avatar
tatewise
Megastar
Posts: 27088
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Plugin: Check for Unlinked Media

Post by tatewise » 21 Dec 2014 11:35

Gerry, the folder name should be 'picasaoriginals\\' with double backslash.

The same error message occurs in FH V5, so you must have worked out how to fix it yourself, from a similar example a few lines later.

The explanation is that backslash \ is an escape character.
It prefixes special cases such as \n = newline, \t = tab, \" = quote, \123 = character with code 123, etc.
So to obtain an actual backslash requires two \\ backslashes.
Whereas \' = apostrophe in the string, and there is no apostrophe to terminate the string.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
gerrynuk
Megastar
Posts: 565
Joined: 25 Apr 2007 09:21
Family Historian: V6
Location: Welwyn Garden City
Contact:

Re: Plugin: Check for Unlinked Media

Post by gerrynuk » 21 Dec 2014 12:06

Thanks for that Mike. I don't remember having to add the second backslash but it is some time since I ran the plugin. Anyway, all seems to OK now.

Post Reply