BLADE - Candidate Headshot Export
The ability to export headshots via a BLADE URL request was introduced in build 14.4.3.3.
Example URL starts with: https://flow-on/blade/election/headshots/...
This returns a zipped folder of the images. The following text files may also be included:
🗒️ _files.txt - a list of files included in the zip folder
🗒️ _messages.txt - optional messages that may indicate if non-fatal errors occurred with specific headshots.
🗒️ _missing.txt - will include a list of unavailable headshots or those it failed to add to the zip folder
URL Parameter | Description |
---|---|
Error Format | Select the data format used if an error message is generated instead of a zip. Select from: XML, JSON, JSONP, BSON |
Election Date | Select an election date from the list near the top of the page. |
Select a Riding | When selected - the results only include headshots from that Riding. It uses the riding number and election date in the URL to identify it. |
Select a Candidate | You can search for a candidate by typing part of their name. It includes candidates for the selected election date. When a candidate is selected the results only include the headshot for that candidate if it exists. |
Select a Watchlist | When selected - the results only include headshots from candidates in the ridings of the watchlist. |
Include Missing | When checked - it will generate a text file with a list of candidates who did not have an assigned headshot to include in the zip file. This generated list is saved as a text file in the zip file. |
Limit | Specify the maximum number of headshots you want included. Useful if you have a large number of candidates and need to limit the download file size. Use in combination with the Offset to get all candidates. |
Offset | Specify the starting point of the headshots you want included. Useful if you have a large number of candidates and need to limit the download file size. Use in combination with the Limit to get all candidates. |
File Format and Alpha Color | The export process can convert the images to either PNG or JPG. If you do not choose a file format - no conversion is attempted. If converting to JPG format it is recommended to specify an Alpha Color to use as the background for any PNG images with alpha (transparent sections) |
Top Folder | The name of the folder to put all the headshots into inside the zip file. |
Sub Folder | You can choose to group the headshots into subfolders using
If you don’t select one of these then all files will go into the top folder. |
Max Width | Specify the width the images should be resized to fit into. |
Max Height | Specify the height the images should be resized to fit into. |
File Name Format | Use the following keywords to create a file name pattern
The keyword names are case sensitive. Write the keyword in all UPPERCASE to use uppercase values. Example [First] vs [FIRST] Example File Name Patterns include:
|
Name Override | Use this field to provide a custom zip file name instead of using the election name which is the default. |
Since | You can use the standard Since field to limit the results to only include headshots whose media record have been updated on or after a date and time you select. |
Quality | A non-zero value causes PNG images to be saved in an 8-bit format for smaller file sizes. A value of 1-100 causes JPG images to be saved with the corresponding quality level. A lower quality level will produce smaller files. If the field is blank or 0 then no change is made. NOTE: this is only able to reduce the quality and file size. |
Tips
Resize Images
Use the Max Width and Max Height field options to resize your images proportionally when exporting.
Compress Files
To try to generate smaller image file sizes - try setting the Quantity field to a non-zero value. See the details for the Quality options in the table above.