The check if the image area is smaller than $wgMaxImageArea can be
bypassed for ForeignApiFile, because the transform of the file is done
on another physical server and therefore has it own check for
$wgMaxImageArea.
A possible TransformTooBigImageAreaError from the foreign server will be
shown when needed (Prepended by message 'thumbnail_error_remote').
Bug: T34387
Change-Id: Iccb25c00e132a4fe744840b7b8db7d9af620bce2
$handler = $this->getHandler();
return $handler ? $handler->isExpensiveToThumbnail( $this ) : false;
}
+
+ /**
+ * Whether the thumbnails created on the same server as this code is running.
+ * @since 1.25
+ * @return bool
+ */
+ public function isTransformedLocally() {
+ return true;
+ }
}
# Clear out the thumbnail directory if empty
$this->repo->quickCleanDir( $dir );
}
+
+ /**
+ * The thumbnail is created on the foreign server and fetched over internet
+ * @since 1.25
+ * @return bool
+ */
+ public function isTransformedLocally() {
+ return false;
+ }
}
return $this->getClientScalingThumbnailImage( $image, $scalerParams );
}
- if ( !$this->isImageAreaOkForThumbnaling( $image, $params ) ) {
+ if ( $image->isTransformedLocally() && !$this->isImageAreaOkForThumbnaling( $image, $params ) ) {
global $wgMaxImageArea;
return new TransformTooBigImageAreaError( $params, $wgMaxImageArea );
}