Last modified: 2010-02-20 17:48:55 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 T24537, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 22537 - ForeignAPIRepo doesn't handle files that have no preview
ForeignAPIRepo doesn't handle files that have no preview
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
File management (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Chad H.
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-02-15 20:53 UTC by Derk-Jan Hartman
Modified: 2010-02-20 17:48 UTC (History)
2 users (show)

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


Attachments
fix thumbs for audio using foreignapirepo (624 bytes, patch)
2010-02-16 00:47 UTC, Derk-Jan Hartman
Details

Description Derk-Jan Hartman 2010-02-15 20:53:35 UTC
When trying to use an audio file such as [[File:Four Inventions.ogg]] from the foreignAPIRepo (Commons specifically), in my own installation of MediaWiki, the following error is produced:

[client ::1] PHP Warning:  file_put_contents(/Users/hartman/Development/phase3/images/thumb/Accordian_chords-01.ogg/): failed to open stream: Is a directory in /Users/hartman/Development/phase3/includes/filerepo/ForeignAPIRepo.php on line 210, referer: http://localhost/wiki/index.php?title=Main_Page&action=edit

A thumb reports: "Error creating thumbnail:", while a noicon inclusion simply creates a redlink.
Comment 1 Derk-Jan Hartman 2010-02-16 00:47:25 UTC
Created attachment 7127 [details]
fix thumbs for audio using foreignapirepo

ForeignApiFile is based on File of course.

File has createThumb()
When no error can be created this returns '' otherwise it returns $thumb->getURL()

The problem is in transform() of ForeignApiFile, which returns 'false' when no thumb can be found. However in the case of an audio file, this is not correct. A thumburl should always be present, or it should render the fullsize version from the original server. Instead of returning false, we pass the invalid thumbUrl value to getTransform, so we get a proper ThumbnailImage returned.

There might be better ways to fix this, but I don't know enough about the File code.
Comment 2 Derk-Jan Hartman 2010-02-16 01:07:12 UTC
Demon, Tim thought that you were the best person to look into this.
Comment 3 Chad H. 2010-02-20 17:48:55 UTC
Done in r62742.

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


Navigation
Links