Elections Head Shot Importer v2

Election data typically does not include images or a head shot of the candidate. These are added and managed by each broadcaster individually. To facilitate the mass import of many (hundreds) of candidates, Chameleon supports a utility called “Elections Headshots Importer”. The latest version of this utility can be found here: http://bannisterlake.com/dl/installs/Chameleon/_elections/

In preparation for using this tool, all the candidate head shots should be placed into a single folder. The tool uses the head shot name to search for matching candidates that are available in the Flow database and then assigned the images as matches are found.

Head shot filename formats

There are 2 formats that are supported by the Headshots Importer:

  • the Classic format and,

  • the Letter-Specifier format.

The preferred format is the Letter-specifier format.

Classic filename format

This filename format is composed of 3 sections with each section separated by an underscore character ( _ ):

  1. Last name(s) - all last name components should be in uppercase letters. If there is more than one word for the last name, keep the spaces in between the names, e.g., LASTNAME1 LASTNAME2.

  2. First name(s) - all first name components should be such that the first letter of each name component is in uppercase and subsequent letters in lowercase. If there is more than a single first name, keep the spaces between the names, e.g., Firstname1 Firstname2.

  3. Party code - this should be comprised of a single word with all uppercase letters, e.g., PCLIB.

Examples:

  • LASTNAME_Firstname_PARTY : ‘TRUDEAU_Justin_LIB’

  • LASTNAME1 LASTNAME2_Firstname_PARTY : ‘VAN DER VEEN_Jessica_NDP’

  • LASTNAME_Firstname1 Firstname2_PARTY : ‘LEBLANC_Paul Emile_PC’

Hyphenated names are treated as a single word by the tool. For example, 'GOODWIN-CLAIRMONT_Vanessa_GRN' indicates that the candidate's last name is: 'Goodwin-Clairmont' and the first name is 'Vanessa'. The same goes for first names. For example, 'ZHANG_Regan-Heng_GRN' indicates that the candidate's last name is 'Zhang' and the first name is 'Regan-Heng'.

Letter-Specifier filename format

This filename format uses a letter followed by the ‘=' character to specify which component of the name the text following the ‘=’ character is. The text following the ‘=’ character is not case sensitive. The order of the name pieces are not important i.e., you can specify the ‘A’ part first or the 'F’ part first, etc.

  • L or l => Indicates that the text is the lastname(s).

  • F or f => Indicates that the text is the firstname(s).

  • P or p => Indicates that the text is the party code.

  • A or a => Indicates that the text is the area name.

  • C or c => Indicates that the text is the area code.

Note that only the lastname specifier is mandatory and the other parts can be absent. However, having absent name parts will make finding the correct candidate in the database more difficult.

Examples:

  • L=lastname F=firstname P=partycode A=areaname : ‘L=Trudeau F=justin p=LIB a=papineau’

  • P=partycode L=lastnames F=firstname : ‘p=ndp f=van der veen L=Jessica’

  • C=areacode L=lastname F=firstnames P=partycode : ‘c=41 L=LEBLANC f=Paul Emile p=PC’

Head Shot Importer Interface

After launching the Importing tool you will be presented with the Preferences dialog. To ensure you have the correct settings use the ‘Test Connection’ button to verify your connection details are correct.

You will also need to specify the folder where the head shot files are located. The option to move imported head shot files to a sub-folder in the source folder is useful if you expect there to be files that won’t be matched properly (which happens quite often especially on initial runs with new files).

The Head Shot Importer functions are as follows:

Content Group - select from available content groups to publish to, where ‘<Global>’ is the default.

Media Bin - select a specific Media Bin.

Events - select 1 or more election events to publish to. This list comes from your Chameleon DB.

Match Level - This option will dictate how loose or tight the search criteria for matching the candidates will be. The looser the level, the more potential candidates there can be although the quality of the matches may not be as good. The following options are available:

  • Regular (default),

  • Tight,

  • Very Tight,

  • Loose,

  • Very Loose.

Filter Matches - this drop-down control will only appear after the candidate matching phase has completed. Changing the selection in the drop-down control will allow the user to focus on a smaller section of head shot items.

The following filter options are available:

  • <No Filter> - shows all items,

  • 0 possible matches,

  • 1 possible match,

  • 2 - 4 possible matches,

  • 5 or more possible matches,

  • Skipped matches - shows items that have ‘<Skip>’ indicated in the ‘Candidate to Use’ column,

  • Accepted matches - only shows items that have been successfully imported into the database. It does this by looking for items that have ‘Accepted’ in the ‘Match Information’ column.

Search Control - allows the user to search for any text in the grid. The user can type Control+F on the keyboard to set the focus to the search control.

Skip Candidates that already have headshots - if this option is checked, any candidate match found in the database that already has an image will not be eligible as an option. The candidate will have a ‘<Skip>’ indicator attached with the option which means the file will not be imported.

Start Import - click this button to start the import process. The import process has 4 distinct phases:

  1. Acquiring the head shot files and parsing their filenames. During this portion of the process, you will see the grid being populated with the images from the files as well as the parsed name components. The number of head shot files found in the source folder will be shown at the right corner of the UI along with a progress bar indicator.

  2. After all the head shot files have been acquired, the next phase will be to try and find matching candidates from the database. You will start to see some information in the ‘Candidate to Use’ column of the grid as well as how many potential matches were found in the top of the ‘Match Information’ column.

  3. The next phase will be for the user to manage the candidate matches found. Once the matching is complete, the ‘Filter Matches’ drop-down list control will appear. This control allows the user to focus on a smaller section of matches. The user can also use the search control to find any text regarding a head shot or candidate match. The tool will automatically try to use the best match for a head shot but sometimes these are not correct and will have to be manually corrected by either choosing a more appropriate candidate or skipping it altogether. To change the candidate match, double click on ‘Candidate to Use’ item for the head shot.

  4. Finally, the user clicks on the ‘Accept’ button to start importing the head shots into the database. During this phase, conflicting candidate matches will have to be resolved first (if any). The following dialog shows what a conflict looks like:

    To resolve a conflict, change the selection on one or more of the items and then click the ‘OK’ button. Clicking on the ‘Cancel’ button reverts the tool back to phase 3 where it will await for further user interaction. Otherwise, it will automatically proceed to the next conflict. Once all conflicts have been resolved, the head shots with selected candidates (that are not marked as ‘<Skip>’) will be imported into the database. A message dialog will then show up indicating how many head shots were successfully imported. The same message is also shown in the status bar at the bottom left of the UI.

 

The tool tries its best to match the candidate names and party information parsed from the filenames against the information in the Flow database. The most likely cause of these mismatches will be that the candidate names in the Flow database do not match exactly the name parsed from the head shot files.

The simplest way to solve this issue is to modify the mismatching filenames such that the candidate names match exactly and then re-run the tool again. Alternatively, If there are less than a handful of unmatched head shots left, you can opt to use the Flow interface to assign the head shot images to the candidates manually.