I'm the main developer behind Practical Plants. We're using InstantCommons to grab images from the commons, but it seems like they're failing to cache locally, making page loads slow and placing unnecessary burden on the Commons.
I've set $wgUseInstantCommons=true
, which downloads images just fine, but doesn't cache them. I get this in my debug.log:
ForeignAPIRepo: HTTP GET: http://commons.wikimedia.org/w/api.php?titles=File%3ABrassica_oleracea0.jpg&iiprop=timestamp%7Cuser%7Ccomment%7Curl%7Csize%7Csha1%7Cmetadata%7Cmime&prop=imageinfo&iimetadataversion=2&format=json&action=query&redirects=true
Class PEAR_Error not found; skipped loading
ForeignAPIRepo: HTTP GET: http://commons.wikimedia.org/w/api.php?titles=File%3ABrassica_oleracea0.jpg&iiprop=url%7Ctimestamp&iiurlwidth=248&iiurlheight=-1&iiurlparam=248px&prop=imageinfo&format=json&action=query&redirects=true
ForeignAPIRepo::getThumbUrl got remote thumb http://upload.wikimedia.org/wikipedia/commons/thumb/1/11/Brassica_oleracea0.jpg/248px-Brassica_oleracea0.jpg
ForeignAPIRepo: HTTP GET: http://commons.wikimedia.org/w/api.php?titles=mwstore%3A%2F%2Fwikimediacommons-backend%2Fwikimediacommons-thumb%2F1%2F11%2FBrassica_oleracea0.jpg%2F248px-Brassica_oleracea0.jpg&prop=imageinfo&format=json&action=query&redirects=true
ForeignAPIRepo::getThumbUrlFromCache Thumbnail was already downloaded before
ForeignAPIRepo: HTTP GET: http://upload.wikimedia.org/wikipedia/commons/thumb/1/11/Brassica_oleracea0.jpg/248px-Brassica_oleracea0.jpg
ForeignAPIRepo::getThumbUrlFromCache could not write to thumb path: mwstore://wikimediacommons-backend/wikimediacommons-thumb/1/11/Brassica_oleracea0.jpg/248px-Brassica_oleracea0.jpg
Note that the path output in the error ForeignAPIRepo:getThumbUrlFromCache
was added by me to try and understand the problem a little, so that lines 300-305 in my ForeignAPIRepo.php file look like this
$op = array( 'op' => 'create', 'dst' => $localFilename, 'content' => $thumb );
if( !$backend->doOperation( $op )->isOK() ) {
wfRestoreWarnings();
wfDebug( __METHOD__ . " could not write to thumb path: ".$localFilename."\n" );
return $foreignUrl;
}
Anyone have a clue what might be going on here? My ./images dir and all subdirectories are 775 (apache user has group rights) so they're definately writable. Furthermore, locally uploaded images work fine.
If I can provide any more information, please let me know!
-
I really doubt it's going to help, but you could try getting a copy of PEAR_Error installed, to see if anything interesting is reported...Charles– Charles2012年12月21日 05:25:44 +00:00Commented Dec 21, 2012 at 5:25
2 Answers 2
Upgrading to 1.20.2 has fixed this issue, so I'm assuming it was just a bug with the version of MediaWiki I was using (1.19.X).
Comments
Note that, starting in MediaWiki 1.27, InstantCommons will hotlink thumbnails instead of generating them locally. This will greatly reduce headaches. The configuration can also be used on older releases.