}
function transform( $params, $flags = 0 ) {
- if ( $this->repo->apiThumbCacheExpiry > 0 && $this->repo->thumbDir ) {
- $thumbUrl = $this->repo->getThumbUrlFromCache(
+ $thumbUrl = $this->repo->getThumbUrlFromCache(
$this->getName(),
isset( $params['width'] ) ? $params['width'] : -1,
isset( $params['height'] ) ? $params['height'] : -1 );
- } else {
- $thumbUrl = $this->repo->getThumbUrl(
- $this->getName(),
- isset( $params['width'] ) ? $params['width'] : -1,
- isset( $params['height'] ) ? $params['height'] : -1 );
- }
if( $thumbUrl ) {
return $this->handler->getTransform( $this, 'bogus', $thumbUrl, $params );;
}
* Only useful if we're locally caching thumbs anyway...
*/
function getThumbPath( $suffix = '' ) {
- $ret = null;
- if ( $this->repo->apiThumbCacheExpiry > 0 && $this->repo->thumbDir ) {
+ if ( $this->repo->canCacheThumbs() ) {
global $wgUploadDirectory;
- $path = $wgUploadDirectory . '/' . $this->repo->thumbDir . '/' . $this->repo->name . '/';
+ $path = $wgUploadDirectory . '/thumb/' . $this->getHashPath( $this->getName() );
if ( $suffix ) {
$path = $path . $suffix . '/';
}