Last modified: 2014-06-04 02:39:59 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T53032, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 51032 - VisualEditor: When inserting an image, set its caption by default to be the Commons image description
VisualEditor: When inserting an image, set its caption by default to be the C...
Status: ASSIGNED
Product: VisualEditor
Classification: Unclassified
Editing Tools (Other open bugs)
unspecified
All All
: Normal enhancement
: ---
Assigned To: Editing team bugs – take if you're interested!
:
Depends on: 66108
Blocks: ve-mediasupport
  Show dependency treegraph
 
Reported: 2013-07-09 12:16 UTC by intracer
Modified: 2014-06-04 02:39 UTC (History)
6 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description intracer 2013-07-09 12:16:43 UTC
When you insert image from commons it is with blank description. It is good to start with description from commons.
Comment 1 Chris McKenna 2013-07-18 14:39:44 UTC
If the description there uses language templates, then it should only use the one corresponding to the language code of the wiki it is on. For example, [[File:Aglais urticae qtl1.jpg]] has descriptions in English, French, German and Lithuanian. When inserted in the English Wikipedia it should only copy the description from the {{en}} template, likewise on the German Wikipedia it should only take from the {{de}} template.
Comment 2 Gerrit Notification Bot 2014-06-03 23:13:08 UTC
Change 137222 had a related patch set uploaded by Mooeypoo:
[wip] Use the image description as the caption

https://gerrit.wikimedia.org/r/137222
Comment 3 Gerrit Notification Bot 2014-06-03 23:53:07 UTC
Change 137222 abandoned by Mooeypoo:
[wip] Use the image description as the caption

Reason:
Blocked on having structured image descriptions.

https://gerrit.wikimedia.org/r/137222
Comment 4 Tisza Gergő 2014-06-04 01:48:33 UTC
For the time being, you could use the extmetadata API:

https://en.wikipedia.org/w/api.php?action=query&prop=imageinfo&iiprop=extmetadata&titles=File:Aglais_urticae_qtl1.jpg&iiextmetadatafilter=ImageDescription&iiextmetadatalanguage=en

https://en.wikipedia.org/w/api.php?action=query&prop=imageinfo&iiprop=extmetadata&titles=File:Aglais_urticae_qtl1.jpg&iiextmetadatafilter=ImageDescription&iiextmetadatalanguage=de

Note that the current caching behavior is not too clever (API response for remote images is cached for 30 days, without any invalidation) and there is no sanitization (other than the one done by MediaWiki on saving) - the description can contain tables, images or any other weird HTML.
Comment 5 James Forrester 2014-06-04 02:39:59 UTC
(In reply to Tisza Gergő from comment #4)
> For the time being, you could use the extmetadata API:
> 
> https://en.wikipedia.org/w/api.
> php?action=query&prop=imageinfo&iiprop=extmetadata&titles=File:
> Aglais_urticae_qtl1.
> jpg&iiextmetadatafilter=ImageDescription&iiextmetadatalanguage=en
> 
> https://en.wikipedia.org/w/api.
> php?action=query&prop=imageinfo&iiprop=extmetadata&titles=File:
> Aglais_urticae_qtl1.
> jpg&iiextmetadatafilter=ImageDescription&iiextmetadatalanguage=de
> 
> Note that the current caching behavior is not too clever (API response for
> remote images is cached for 30 days, without any invalidation) and there is
> no sanitization (other than the one done by MediaWiki on saving) - the
> description can contain tables, images or any other weird HTML.

I think we're better off waiting than coming up with a hack to drop "unwanted" tables but strip out the bits we do want, but thank you. :-)

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links