Manual:refreshImageMetadata.php
MediaWiki version: | ≥ 1.18 |
MediaWiki file: refreshImageMetadata.php | |
---|---|
Location: | maintenance/ |
Source code: | master • 1.42.4 • 1.41.5 • 1.39.11 |
Classes: | RefreshImageMetadata |
Details
editrefreshImageMetadata.php file is a maintenance script to refresh image metadata fields. It processes 200 items in a batch.
Options/Arguments
editOption | Description | Required? |
---|---|---|
--force | Reload metadata from file even if the metadata looks ok. | Optional |
--broken-only | Only fix really broken records, leave old but still compatible records alone. | Optional |
--convert-to-json | Fix records with an out of date serialization format. | Optional |
--split | Enable splitting out large metadata items to the text table. Implies --convert-to-json. |
Optional |
--verbose | Output extra information about each upgraded/non-upgraded file. | Optional |
--start | Name of file to start with. Spaces must be replaced by underscores, since the parameter will be used to match the file name as stored in the database. | Optional |
--end | Name of file to end with. | Optional |
--mediatype | Only refresh files with this media type, e.g. BITMAP, UNKNOWN etc. | Optional |
--mime | Only refresh files with this MIME type. Can accept wild-card 'image/*'. Potentially inefficient unless mediatype is also specified |
Optional |
--metadata-contains | (Inefficient!) Only refresh files where the img_metadata field contains this string. Can be used if its known a specific property was being extracted incorrectly | Optional |
--sleep | Time to sleep between each batch (in seconds). Default: 0 | Optional |
--oldimage | Run and refresh on oldimage table. |
Optional |
Usage
editphp maintenance/run.php refreshImageMetadata [ --force| --broken-only| --convert-to-json| --split| --verbose| --start| --end| --mediatype| --mime| --metadata-contains| --sleep| --oldimage ]
Terminal
$ php maintenance/run.php refreshImageMetadata Processing next 3 row(s) starting with 1631330937964.jpeg. Finished refreshing file metadata for 3 files. 3 were refreshed, 0 were already up to date, and 0 refreshes were suspicious.
In MediaWiki version 1.39.10 and earlier, you must invoke maintenance scripts using
php maintenance/scriptName.php
instead of php maintenance/run.php scriptName
.