Last modified: 2010-02-20 17:48:55 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.
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.
Demon, Tim thought that you were the best person to look into this.
Done in r62742.