https://bugzilla.wikimedia.org/show_bug.cgi?id=71690

            Bug ID: 71690
           Summary: MMV: Viewer displays strange "YYYY:MM:DD" colon
                    separated format
           Product: MediaWiki extensions
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: MultimediaViewer
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected], [email protected]
       Web browser: ---
   Mobile Platform: ---

Example:

http://commons.wikimedia.org/wiki/File:Pelican_in_its_piety.jpg#mediaviewer/File:Pelican_in_its_piety.jpg

The viewer shows "Created: 2006:03:19 10:29:45"

I'm not sure what that format is supposed to be, but it looks like an error.
Afaik no human readable standard uses that format. It certainly doesn't seem
like something we'd do on purpose (based on a MediaWiki Language or Moment.js
format), which is enough for it to be an error from the user's perspective.

Looking at the regular file page, it seems MediaWiki has no problem parsing
this Metadata:

 Date and time of data generation
 10:29, 19 March 2006

So seems fair to expect MMV to handle this as well.

Simple Commons gadgets have never had this issue. A simple extraction of the
'.exif-datetimeoriginal' node in #mw_metadata would be a step forward (instead
of the imageinfo API and trying to parse it). Since that's already parsed an
localised server-side. Scraping is ugly, but parsing should make it better.

The value is exposed via the imageinfo API:

http://commons.wikimedia.org/w/api.php?action=query&format=json&prop=imageinfo&titles=File%3APelican_in_its_piety%2Ejpg&iiprop=timestamp%7Cuser%7Curl%7Csize%7Cmime%7Cmediatype%7Cextmetadata&iiextmetadatafilter=DateTime%7CDateTimeOriginal%7CImageDescription%7CLicense%7CLicenseShortName%7CUsageTerms%7CLicenseUrl%7CCredit%7CArtist%7CGPSLatitude%7CGPSLongitude%7CPermission&iiextmetadatalanguage=en

    "extmetadata": {
        "DateTime": {
            "value": "2006:03:19 10:29:45",
            "source": "file-metadata",
            "hidden": ""
        },
        "ImageDescription": {
            "value": "KONICA MINOLTA DIGITAL CAMERA",
            "source": "file-metadata"
        },
        "DateTimeOriginal": {
            "value": "2006:03:19 10:29:45",
            "source": "file-metadata"
        }
    },
    "mime": "image/jpeg",
    "mediatype": "BITMAP"

Bug seems to originate from
https://github.com/wikimedia/mediawiki-extensions-MultimediaViewer/blob/c86b2bba26726f2c36c340eeff7afd8d7a1c0df4/resources/mmv/ui/mmv.ui.metadataPanel.js#L672-L693
where it attempts to have Moment.js parse this format. Which it can't.

Momment.js has, however, a built-in capability to parse custom formats by
passing the format as the second argument:

> moment('2006:03:19 10:29:45')
< Invalid date
> moment('2006:03:19 10:29:45', 'YYYY:M:D H:m:s')
< "Sun Mar 19 2006 10:29:45"

If this colon-separated format is how all Image metadata is stored by camera's,
I'd say just parse it by telling moment.js the format.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to