* Optional summary parameter to action=rollback, for user javascript
* (bug 153) Adjust thumbnail size calculations to match consistently;
patch by David Benbennick
+* (bug 4162) Add $wgThumbnailEpoch timestamp to force old thumbs to
+ be rerendered on demand, sitewide
=== Caveats ===
* 12.5 million pixels or 3500x3500
*/
$wgMaxImageArea = 1.25e7;
+/**
+ * If rendered thumbnail files are older than this timestamp, they
+ * will be rerendered on demand as if the file didn't already exist.
+ * Update if there is some need to force thumbs and SVG rasterizations
+ * to rerender, such as fixes to rendering bugs.
+ */
+$wgThumbnailEpoch = '20030516000000';
+
+
/** Set $wgCommandLineMode if it's not set already, to avoid notices */
if( !isset( $wgCommandLineMode ) ) {
function renderThumb( $width, $useScript = true ) {
global $wgUseSquid, $wgInternalServer;
global $wgThumbnailScriptPath, $wgSharedThumbnailScriptPath;
- global $wgSVGMaxSize, $wgMaxImageArea;
+ global $wgSVGMaxSize, $wgMaxImageArea, $wgThumbnailEpoch;
$fname = 'Image::renderThumb';
wfProfileIn( $fname );
$thumbName = $this->thumbName( $width, $this->fromSharedDirectory );
$thumbPath = wfImageThumbDir( $this->name, $this->fromSharedDirectory ).'/'.$thumbName;
- if ( !file_exists( $thumbPath ) ) {
+ if ( !file_exists( $thumbPath ) ||
+ filemtime( $thumbPath ) < wfTimestamp( TS_UNIX, $wgThumbnailEpoch ) ) {
$oldThumbPath = wfDeprecatedThumbDir( $thumbName, 'thumb', $this->fromSharedDirectory ).
'/'.$thumbName;
$done = false;