Commons:LrMediaWiki

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search
LrMediaWiki (COM:LRMW)

LrMediaWiki is a free and open-source plug-in for Adobe Photoshop Lightroom that supports exports of media files (photos/images) to MediaWiki instances.

Installation[edit]

Requirements[edit]

LrMediaWiki requires a Lightroom 4, 5, 6/CC, Classic CC or Classic installation and runs on both, Windows and macOS.

Installation[edit]

  • Download the latest version of LrMediaWiki from GitHub (currently LrMediaWiki-1.3.zip).
  • The archive contains a folder called LrMediaWiki.lrplugin. Unpack it to a location of your choice, but do not change the name of the folder LrMediaWiki.lrplugin.
  • In Lightroom, open the Plug-in Manager (Windows and macOS: FilePlug-in Manager…).
  • Click Add and select the LrMediaWiki.lrplugin you unpacked before.
  • “LrMediaWiki” should now appear in the listing on the left. Confirm that its icon is green and the status is “Installed and running.”
  • Add this page to your watchlist to see when there are new releases. Update the plug-in the same way that you installed it. There is no auto-update mechanism in the moment.

Usage[edit]

LrMediaWiki export dialog (v0.4)

LrMediaWiki adds the target “MediaWiki” to the Lightroom export dialog. As a first step, it is recommended to create an export preset with your username, your preferred license, your user categories and your preferred naming scheme. Afterwords, use the file metadata to specify file descriptions and categories (one of the metadata sets “LrMediaWiki – Artwork”, “LrMediaWiki – Information”, “LrMediaWiki – Information (de)” or “LrMediaWiki – Object Photo”).

Login settings (per export)[edit]

At the “LrMediaWiki Login Information” section of the export dialog, you have to specify your login credentials and the MediaWiki installation to which you want to upload the files.

Username
Your MediaWiki username
Password
Your MediaWiki password
Note: if you have switched to 2-Factor-Authentication then your normal MediaWiki credentials will not work. You must create a bot password using Special:BotPasswords for this plug-in. Call this bot password "LrMediaWiki" and grant it rights "Edit existing pages", "Create, edit, and move pages", "Upload new files", and "Upload, replace, and move files". The username will then be your-username@LrMediaWiki and the password the bot password generated. Save this somewhere safe and remember to save the change to the Lightroom plug-in by right-clicking on your export preset and select "Update with Current Settings".
API Path
The path to the api.php file of the MediaWiki installation you want to access. To determine the path, go to “Special:Version” → “Entry point URLs” → “api.php” of the intended MediaWiki. For Wikimedia wikis, this is https://subproject.project.org/w/api.php, e. g. https://commons.wikimedia.org/w/api.php. Be sure to use a secure connection (HTTPS) to protect your login credentials. If you just want to test, you can use the Beta Commons at https://commons.wikimedia.beta.wmflabs.org/w/api.php.

Upload settings (per export)[edit]

At the “LrMediaWiki Upload Information” section of the export dialog, you have to specify details for the description pages of the uploaded files.

Infobox Template
Select one of “Information”, “Information (de)”, “Artwork” or “Object photo”.
If you press the button “Preview of generated wikitext”, you can check the description page that LrMediaWiki will generate for you. If you had selected multiple files, you can flip through the selected files by the buttons |◀ (first), (previous), (next) and ▶| (last).
Source
The source of the files, usually {{own}}.
Author
The author of the files, usually [[User:YourUserName|YourRealName]].
Permission
Permission information like {{PermissionOTRS}}
Other templates
Other templates like {{Panorama}} or {{Personality rights}} that will be added below {{Information}} and above the license section.
License
The license template to use, e. g. {{Cc-by-sa-4.0}}. Can also contain additional templates that are placed below the {{Information}}.
Categories
The categories all uploaded pictures should be added to, without the Category: prefix. Separate multiple categories with a ;. All uploads are added to Category:Uploaded with LrMediaWiki by default.
Gallery
If this field is set, LrMediaWiki adds a gallery of your uploads to the page with the specified title.

Upload settings (per file)[edit]

Fields per file

The file description used on the description page and the categories are taken from the file metadata. In Lightroom's library module open the metadata section at the right panel (shortcut Windows: Ctrl+4, macOS: cmd+4) and select at the upper left corner the Metadata Set “MediaWiki for Lightroom”. LrMediaWiki supports the generation of three different infobox templates, either {{Information}}, {{Artwork}} or {{Object photo}}. At export dialog you will be urged to select one of the three templates. The fields of the Metadata Set “MediaWiki for Lightroom" are clustered in three sections, a general section with fields used by all infobox templates; the sections “Artwork” and “Object photo” are only used by these infobox templates:

  • If you intend to use {{Information}} at export, use the seven fields of the general section. The fields of the sections “Artwork” and “Object photo” will be ignored at export.
  • If you intend to use {{Artwork}} at export, use the seven fields of the general section and the fields of the section “Artwork”. The fields of the section “Object photo” will be ignored at export.
  • If you intend to use {{Object photo}} at export, use the seven fields of the general section and the fields of the section “Object photo”. The fields of the section “Artwork” will be ignored at export.

You can specify:

General section[edit]

Description (en)
An English description using wiki markup, e. g. A special [[:en:file|]].
Description (de)
A German description using wiki markup, e. g. Eine spezielle [[:de:Datei|]].
Description (other)
Additional wiki markup for descriptions in other languages to be placed below the English and the German descriptions using, e. g. {{fr|1=Description française}}.
Templates
Templates, embedded in {{}}
Categories
Categories, separated by the character ";" – avoid blanks before and after this separator character
Other versions
Other versions
Other fields
Other fields like a {{Credit line}}

Furthermore the Date for {{Information}} and {{Object photo}} is taken from the IPTC field “Date Created”.

Section "Artwork"[edit]

The fields in this section (from Artist to Wikidata) refer to the template parameters of {{Artwork}}. Please view the documentation of this template for usage of its fields.

Section "Object photo"[edit]

The fields in this section (Object, Detail and Detail position) refer to the template parameters of {{Object photo}}. Please view the documentation of this template for usage of its fields.

Samples[edit]

The two samples illustrate how entries at file level (right side) and at export dialog (middle) result to a preview of the generated wikitext (left).

Plugin settings[edit]

LrMediaWiki configuration

Open FilePlug-in ManagerLrMediaWiki to access these settings.

Create snapshots on export
If checked, a development snapshot will be created after every successful MediaWiki export.
Export keyword
If set, this keyword will be added to the photo after a successful MediaWiki export.
Check for new plugin versions
If checked, LrMediaWiki checks whether there are updates for this plugin after every start of LrMediaWiki (by sending a query to github.com).
Enable logging
If checked, LrMediaWiki writes all requests and responses to a log file in your “Documents” folder. Be very careful when using this option as this includes the login request with your password! You should only enable this option if you really need it, and you should not share log files without checking their content.
Preview
The settings of “Font Name” and “Font Size” will be used at “Preview of generated wikitext”.

Placeholders[edit]

LrMediaWiki provides a concept of placeholders. Placeholders can be inserted in LrMediaWiki fields and are substituted at preview and upload by the content of the placeholder field. Placeholders can be used at every LrMediaWiki field, per file and at export dialog.

To illustrate, how the placeholders can be used, let’s assume a fictional usage scenario: We might have a set of three photos, showing portrait photos of the three Apollo 11 astronauts. All LrMediaWiki description fields should be similar, composed by general terms and individual ones. A LrMediaWiki description field could have this entry: "Apollo 11 mission, astronaut <title>". This description uses the placeholder <title>. The description would be the same at all three photos. If the three different photos have individual entries at Lightroom field "Title" ("Neil Armstrong", "Buzz Aldrin" or "Michael Collins"), the placeholder <title> will be substituted by these field entries. E. g., a placeholder substitution would result to a description field "Apollo 11 mission, astronaut Neil Armstrong" if "Neil Armstrong" has been set at Lightroom field "Title". To prove, if the placeholder substitution will work as expected, we can use the "Preview of generated Wikitext" at export dialog.

By the way, instead of using <title>, at this usage scenario <personShown> would fit too (or better).

Placeholders and mapping to Lightroom fields
Placeholder Lightroom field Description
<fileName> File Name The leaf name of the file (for example, "myFile.jpg")
<copyName> Copy Name The name associated with this copy. This is the best field to use for a custom filename at export. Use "Custom Settings" for the filename and insert the Copy Name. This allows for different filenames for different processes (e.g., colour or b&w) and crops. If you have taken several photos of the same subject, your Title can all be the same but the Copy Name unique.
<folderName> Folder / File Path The name of the folder the file is in. The label “Folder” is used at Metadata Sets “Default”, “All Plug-in Metadata”, “EXIF and IPTC”, “Location” and “Quick Describe”; the label “File Path” is used at Metadata Set “EXIF”.
<path> Path The current path to the photo file if available; otherwise, the last known path to the file.
<fileSize> File Size
Example: 23.27 MB
The formatted size of the file, or, if the file is offline, but there is a smart preview, the size of the smart[1]
<fileType> File Type The user-visible file type (DNG, RAW, etc.)
<rating> Rating The user rating of the file (number of stars), values: 1 … 5
<label> Label
Example: Red
The name of assigned color label
<colorNameForLabel> Color Label
Example: red
The color name corresponding to the color label associated with this photo. One of "red", "yellow", "green", "blue", "purple", "white" (= arbitrary), "grey" (= none). Supplying any other string at "Label" field will cause the photo to be displayed with a white color label indicator.
<caption> Caption A textual description, including captions, of the image; same as Description
EXIF All fields of Metadata Set "EXIF"
<dimensions> Dimensions The original dimensions of file (for example, "5472 x 3648")
<width> Width The original width of file (for example, "5472")
<height> Height The original height of file (for example, "3648")
<aspectRatio> Aspect Ratio The aspect ratio of the photo (defined as width / height). For example, a standard 35mm photo in landscape mode returns 1.5.
<croppedDimensions> Cropped The cropped dimensions of file (for example, "4612 x 3452")
<croppedWidth> Cropped width The cropped width of file (for example, "4612")
<croppedHeight> Cropped height The cropped height of file (for example, "3452")
<dateTimeOriginal> Date Time Original
Example: 9/15/05 5:32:50 PM
The date and time of capture (for example, "09/15/2005 17:32:50"). Formatting can vary based on the user's localization settings.[2]
<dateTimeDigitized> Date Time Digitized
Example: 9/15/05 5:32:50 PM
The date and time of scanning (for example, "09/15/2005 17:32:50"). Formatting can vary based on the user's localization settings.[2]
<dateTime> Date Time
Example: 9/15/05 5:32:50 PM
Adjusted date and time (for example, "09/15/2005 17:32:50"). Formatting can vary based on the user's localization settings.[2]
<exposure> Exposure
Example: ¹⁄₆₀ sec at ƒ / 2,8
The exposure summary (for example, "1/60 sec at f/2.8")
<shutterSpeed> Shutter Speed
Example: ¹⁄₆₀ sec
The shutter speed (for example, "1/60 sec")
<shutterSpeedRaw> Shutter Speed raw The shutter speed, in seconds (for example, "0.016666" = 1/60 sec)
<aperture> Aperture The aperture (for example, "ƒ / 2,8")
<apertureRaw> Aperture raw The denominator of the aperture (for example, "2.8")
<focalLength> Focal Length The focal length of lens as shot (for example, "132 mm")
<focalLength35mm> Focal Length 35mm The focal length as 35mm equivalent (for example, "211 mm")
<brightnessValue> Brightness Value The brightness value (for example, "-2")
<exposureBias> Exposure Bias
Example: ‒ ¹¹⁄₃₂ EV
The exposure bias/compensation (for example, "-2/3 EV")
<isoSpeedRating> ISO Speed Rating The ISO speed rating (for example, "ISO 200")
<flash> Flash
Example: Did fire
Whether the flash fired or not (for example, "Did fire")
<exposureProgram> Exposure Program
Example: Aperture priority
The exposure program (for example, "Aperture priority")
<meteringMode> Metering Mode
Example: Pattern
The metering mode (for example, "Pattern")
<subjectDistance> Subject Distance The subject distance (for example, "3.98 m").[1]
<cameraMake> Make The camera manufacturer
<cameraModel> Model The camera model
<cameraSerialNumber> Serial Number The camera serial number
<lens> Lens The lens (for example, "28.0-135.0 mm")
<artist> Artist The artist’s name
<software> Software The software used to process/create photo
Not available User Comment This field can not be provided as a placeholder, due to a known bug.
<gps> GPS The location of this photo (for example, "50°39'55" N 7°12'35" E")
<gpsLat> Latitude The latitude of the location of this photo (for example, "50.665211111112")
<gpsLon> Longitude The longitude of the location of this photo (for example, "7.2098472222217")
<gpsAltitude> Altitude
Example: 295.6 m
The GPS altitude for this photo (for example, "295.6 m")[1]
<gpsAltitudeRaw> Altitude raw The GPS altitude for this photo in meter (for example, "295.6012")
<gpsImgDirection> Direction
Example: South-West
The GPS direction for this photo (for example, "South-East"). Access to this field needs a Lightroom version CC/6 or newer.
<gpsImgDirectionRaw> Direction raw The GPS direction for this photo in degrees (for example, "225"). Access to this field needs a Lightroom version CC/6 or newer.
IPTC – Contact Metadata Set "IPTC", section "Contact". The creator's contact information provides all necessary information to get in contact with the creator of this image and comprises a set of sub-properties for proper addressing.
<creator> Creator Contains the name of the photographer, but in cases where the photographer should not be identified the name of a company or organisation may be appropriate.
<creatorJobTitle> Job Title Contains the job title of the photographer. As this is sort of a qualifier the Creator element has to be filled in as mandatory prerequisite for using Creator's Jobtitle.
<creatorAddress> Address The contact information address part. Comprises an optional company name and all required information to locate the building or postbox to which mail should be sent. To that end, the address is a multiline field.
<creatorCity> City The contact information city part.
<creatorStateProvince> State / Province The contact information part denoting regional information such as state or province.
<creatorPostalCode> Postal Code The contact information part denoting the local postal code.
<creatorCountry> Country The contact information country part.
<creatorPhone> Phone The contact information phone number part. Enter the work phone number(s) for the person that created this image, using the international format, such as +1 (123) 456789. Multiple numbers can be given. May have to be separated by a comma in the user interface.
<creatorEmail> E-Mail The contact information email address part. Enter the work email address(es) for the person that created this image, such as [email protected]. Multiple email addresses can be given. May have to be separated by a comma in the user interface.
<creatorUrl> Website The contact information web address part. Multiple addresses can be given. May have to be separated by a comma in the user interface. Enter the work Web URL(s) for the person that created this image, such as http://www.domain.com/.
IPTC – Content Metadata Set "IPTC", section "Content"
<headline> Headline A brief synopsis of the caption. Headline is not the same as Title. Enter a brief publishable synopsis or summary of the contents of the image.
<caption> Description A textual description, including captions, of the image. Enter a "caption" describing the who, what, and why of what is happening in this image, this might include names of people, and/or their role in the action that is taking place within the image. The same as Caption.
<iptcSubjectCode> IPTC Subject Code Specifies one or more subjects from the IPTC Subject-NewsCodes taxonomy to categorise the image. Each subject is represented as a string of 8 digits in an unordered list. Enter only values from the IPTC Subject NewsCode Controlled Vocabulary (see: http://www.newscodes.org/).
<descriptionWriter> Description Writer Identifier or the name of the person involved in writing, editing or correcting the description of the image.
<iptcCategory> Category Deprecated. As this metadata element was earmarked as deprecated already for IIM 4.1, it was not adopted. However, this data is still synchronised with the XMP property “photoshop:Category”, and hence available for future use – but outside the IPTC Core.
<iptcOtherCategories> Other Categories Deprecated. As this metadata element was earmarked as deprecated already for IIM 4.1, it was not adopted. However, this data is still synchronised with the XMP property “photoshop:SupplementalCategories”, and hence available for future use – but outside the IPTC Core.
IPTC – Image Metadata Set "IPTC", section "Image"
<dateCreated> Date Created The IPTC-formatted creation date (for example, "2005-09-20T15:10:55Z"). Designates the date and optionally the time the content of the image was created rather than the date of the creation of the digital representation. Enter the date the image was taken. Implementers are encouraged to provide the creation date and time from the EXIF data of a digital camera to the user for entering this date for the first time.
<creationDate> Creation Date Format: YYYY:MM:DD, example: 2005:09:20. This is a part of the field "Date Created", hyphens substituted by colons. No IPTC standard field.
<creationTime> Creation Time Format: hh:mm:ss, example: 15:10:55. This is a part of the field "Date Created". No IPTC standard field.
<intellectualGenre> Intellectual Genre Describes the nature, intellectual, artistic or journalistic characteristic of an image. Enter a term to describe the nature of the image in terms of its intellectual or journalistic characteristics, such as daybook, or feature (examples at: http://www.newscodes.org/).
<scene> IPTC Scene Code Describes the scene of a photo content. Specifies one ore more terms from the IPTC "Scene-NewsCodes". Each Scene is represented as a string of 6 digits in an unordered list. Enter only values from the IPTC Scene NewsCodes Controlled Vocabulary (see: http://www.newscodes.org/).
<location> Sublocation Exact name of the sublocation shown in the image. This sublocation name could either be the name of a sublocation to a city or the name of a well known location or (natural) monument outside a city. In the sense of a sublocation to a city this element is at the fourth level of a top-down geographical hierarchy.
<city> City Name of the city of the location shown in the image. This element is at the third level of a top-down geographical hierarchy.
<stateProvince> State / Province Name of the subregion of a country of the location shown in the image. This element is at the second level of a top-down geographical hierarchy.
<country> Country Full name of the country of the location shown in the image. This element is at the top/first level of a top-down geographical hierarchy. The full name should be expressed as a verbal name and not as a code, a code should go to the element "CountryCode".
<isoCountryCode> ISO Country Code This element is at the top/first level of a top-down geographical hierarchy. The code should be taken from ISO 3166 two or three letter code. The full name of a country should go to the "Country" element.
IPTC – Status/Workflow Metadata Set "IPTC", section "Status" and Metadata Set "EXIF and IPTC", section "Workflow"
<title> Title A shorthand reference for the digital image. Title provides a short human readable name which can be a text and/or numeric reference. It is not the same as Headline. Enter a short verbal and human readable name for the image, this may be the file name. Many use the Title field to store the filename of the image, though the field may be used in many ways. Formal identifiers are provided by the Digital Image Id, or the Registry Entry property of the IPTC Extension.
<jobIdentifier> Job Identifier Number or identifier for the purpose of improved workflow handling. This is a user created identifier related to the job for which the image is supplied. Enter a number or identifier needed for workflow control or tracking. As this identifier references a job of the receiver's workflow it must first be issued by the receiver, then transmitted to the creator or provider of the news object and finally added by the creator to this field.
<instructions> Instructions Any of a number of instructions from the provider or creator to the receiver of the image which might include any of the following: embargoes (NewsMagazines OUT) and other restrictions not covered by the "Rights Usage Terms" field; information regarding the original means of capture (scanning notes, colourspace info) or other specific text information that the user may need for accurate reproduction; additional permissions required when publishing; credits for publishing if they exceed the IIM length of the credit field. Enter information about embargoes, or other restrictions not covered by the Rights Usage field.
<provider> Creditline The credit to person(s) and/or organisation(s) required by the supplier of the image to be used when published. This is a free-text field. Enter who should be credited when this image is published. For more formal identifications of the creator or the owner of the copyrights of this image other rights properties may be used.
<source> Source Identifies the original owner of the copyright for the intellectual content of the image. This could be an agency, a member of an agency or an individual. Source could be different from Creator and from the entities in the Copyright Notice. Enter the original owner of the copyright of this image. This field may be used primarily in syndication workflows.
IPTC – Copyright Metadata Set "IPTC", section "Copyright"
<copyrightState> Copyright Status
Example: Copyrighted
The copyright state for this image. One of "unknown", "copyrighted", or "public domain". This field is not covered by the IPTC standard.
<copyright> Copyright
Example: © 2008 Jane Doe
Contains any necessary copyright notice for claiming the intellectual property for this photograph and should identify the current owner of the copyright for the photograph. Other entities like the creator of the photograph may be added in the corresponding field. Notes on usage rights should be provided in "Rights usage terms". Enter a notice on the current owner of the copyright for this image, such as © 2008 Jane Doe. Copyright ownership can be expressed in a more controlled way using the PLUS fields "Copyright Owner", "Copyright Owner ID", "Copyright Owner Name" of the IPTC Extension. It is the user's responsibility to keep the values of the four fields in sync.
<rightsUsageTerms> Rights Usage Terms The licensing parameters of the image expressed in free-text. Enter instructions on how this image can legally be used. The PLUS fields of the IPTC Extension can be used in parallel to express the licensed usage in more controlled terms.
<copyrightInfoUrl> Copyright Info URL
Example: CC BY 4.0 (en)
This field is not covered by the IPTC standard.
IPTC Extension – Description Metadata Set "IPTC Extension", section "Description"
<personShown> Person Shown Name of a person shown in the image.
<nameOfOrgShown> Name of Org Shown Name of the organisation or company which is featured in the image. May be supplemented by values from a controlled vocabulary in the Organisation Code field.
<codeOfOrgShown> Code of Org Shown Code from a controlled vocabulary for identifying the organisation or company which is featured in the image. Enter an identifier for the controlled vocabulary, then a colon, and finally the code from the vocabulary assigned to the organisation shown in this image (e.g. nasdaq:companyA). For example a stock ticker symbol may be used.
<event> Event Names or describes the specific event at which the photo was taken. Examples are: a press conference, dedication ceremony, etc. If this is a sub-event of a larger event both can be provided by the field: e.g. XXXIX Olympic Summer Games (Beijing): opening ceremony. Unplanned events could be named by this property too.
Keywords Keywords to express the subject of the image. Keywords may be free text and don't have to be taken from a controlled vocabulary. Codes from the controlled vocabulary IPTC Subject NewsCodes must go to the "Subject Code" field. Enter any number of keywords, terms or phrases used to express the subject matter in the image.
<keywordTags> Keywords The list of keywords as shown in the Keyword Tags panel (with Enter Keywords selected). This is the exact set of tags that were directly applied to the photo without any filtering for "Show on Export" flags, etc.
<keywordTagsForExport> Keywords The list of keywords as shown in the Keyword Tags panel (with Will Export selected). This removes tags that were meant to be hidden via "Show on Export" and inserts all of the parents and ancestor tags (except when silenced via "Export Containing Keywords").
Current date Examples
<currentIsoDate> 2021-01-09
<currentLongDate> 9. Januar 2021[2]
<currentMediumDate> 09.01.2021[2]
<currentShortDate> 09.01.21[2]
<currentYear> 2021
<currentYearXX> 21
<currentMonth> 1
<currentMonthXX> 01
<currentMonthName> January
<currentDay> 9
<currentDayXX> 09
<currentDayName> Saturday
<currentTime> 20:22:15
<currentHour> 20
<currentMinute> 22
<currentSecond> 15
  1. a b c The decimal number separator of this field depends on a user setting at operation system level. Changes can be done at the same context as changes of date/time formats.
  2. a b c d e f The format of this date/time field depends on user settings at operation system level. Format changes can by done by:
    Windows:
    • Settings → Time & language → Date & time → Formats → Change date and time formats → Short date
    • Settings → Time & language → Date & time → Formats → Change date and time formats → Long time
    macOS:
    • System Preferences → Language & Region → Advanced… → Dates → Short
    • System Preferences → Language & Region → Advanced… → Times → Medium

Italic marked fields are not displayed at Lightroom’s user interface.
The descriptions are mainly taken from the Lightroom Software Development Kit (SDK) documentation. The IPTC descriptions are taken from IPTC Standard Photo Metadata (July 2010) (PDF).

Troubleshooting[edit]

For error reports, feedback, questions or feature requests, please use the bugtracker on GitHub or the talk page Commons talk:LrMediaWiki. Here are some known problems and hints.

Export presets
You can easily define export presets using the target MediaWiki. If you specify your default author, source, license and categories and save this export preset, you can just right-click on a file and select ExportWith Presets → Your Preset to upload a file.
What happens if there already is a file with the name I chose?
LrMediaWiki will ask you what to do: You can stop the upload of your file, you can overwrite the existing file with a comment and you can change the name of your file.
Category autocompletion
At the moment, there is no category autocompletion. It’s possible to add this to the export dialog, but it would be much more helpful if there was autocompletion for the file categories. I’m still looking for a way to implement this.
Input validation
At the moment, there is no validation of your input. You can use license templates or add categories that do not exist.

Support[edit]

Please support LrMediaWiki by

  • using and testing (and giving feedback!),
  • writing, translating and improving the documentation or
  • help coding.

If you have questions, please leave a message on the talk page Commons talk:LrMediaWiki.

External links[edit]