Index: trunk/phase3/includes/Image.php |
— | — | @@ -912,7 +912,7 @@ |
913 | 913 | function renderThumb( $width, $useScript = true ) { |
914 | 914 | global $wgUseSquid, $wgInternalServer; |
915 | 915 | global $wgThumbnailScriptPath, $wgSharedThumbnailScriptPath; |
916 | | - global $wgSVGMaxSize, $wgMaxImageArea; |
| 916 | + global $wgSVGMaxSize, $wgMaxImageArea, $wgThumbnailEpoch; |
917 | 917 | |
918 | 918 | $fname = 'Image::renderThumb'; |
919 | 919 | wfProfileIn( $fname ); |
— | — | @@ -968,7 +968,8 @@ |
969 | 969 | $thumbName = $this->thumbName( $width, $this->fromSharedDirectory ); |
970 | 970 | $thumbPath = wfImageThumbDir( $this->name, $this->fromSharedDirectory ).'/'.$thumbName; |
971 | 971 | |
972 | | - if ( !file_exists( $thumbPath ) ) { |
| 972 | + if ( !file_exists( $thumbPath ) || |
| 973 | + filemtime( $thumbPath ) < wfTimestamp( TS_UNIX, $wgThumbnailEpoch ) ) { |
973 | 974 | $oldThumbPath = wfDeprecatedThumbDir( $thumbName, 'thumb', $this->fromSharedDirectory ). |
974 | 975 | '/'.$thumbName; |
975 | 976 | $done = false; |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -1179,7 +1179,16 @@ |
1180 | 1180 | * 12.5 million pixels or 3500x3500 |
1181 | 1181 | */ |
1182 | 1182 | $wgMaxImageArea = 1.25e7; |
| 1183 | +/** |
| 1184 | + * If rendered thumbnail files are older than this timestamp, they |
| 1185 | + * will be rerendered on demand as if the file didn't already exist. |
| 1186 | + * Update if there is some need to force thumbs and SVG rasterizations |
| 1187 | + * to rerender, such as fixes to rendering bugs. |
| 1188 | + */ |
| 1189 | +$wgThumbnailEpoch = '20030516000000'; |
1183 | 1190 | |
| 1191 | + |
| 1192 | + |
1184 | 1193 | /** Set $wgCommandLineMode if it's not set already, to avoid notices */ |
1185 | 1194 | if( !isset( $wgCommandLineMode ) ) { |
1186 | 1195 | $wgCommandLineMode = false; |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -289,6 +289,8 @@ |
290 | 290 | * Optional summary parameter to action=rollback, for user javascript |
291 | 291 | * (bug 153) Adjust thumbnail size calculations to match consistently; |
292 | 292 | patch by David Benbennick |
| 293 | +* (bug 4162) Add $wgThumbnailEpoch timestamp to force old thumbs to |
| 294 | + be rerendered on demand, sitewide |
293 | 295 | |
294 | 296 | |
295 | 297 | === Caveats === |