Manual:image table

From MediaWiki.org
Jump to: navigation, search
Manual:Contents MediaWiki database layout image table


The image table describes images and other uploaded files. However, the image description pages are stored like other pages. See also: Manual:Image Administration. Many of the fields in this table are analogous to those in the oldimage table. Some of this information was adapted from schema.doc in the MediaWiki docs/ directory.

The path for the actual image is not stored in this table: see Manual:$wgHashedUploadDirectory.

Fields[edit | edit source]

img_name[edit | edit source]

Filename.

img_size[edit | edit source]

File size in bytes.

img_width[edit | edit source]

MediaWiki version: 1.5

Image width, in pixels.

img_height[edit | edit source]

Image height, in pixels.

img_metadata[edit | edit source]

MediaWiki version: 1.5

Serialized PHP array of the file's properties.

img_bits[edit | edit source]

Bit-depth of GIF/PNG palette-based images (up to 8-bit). Non-palette images (JPEG/PNG/TIFF/SVG) are 0, 8, or 16. All other files default to 0.

img_media_type[edit | edit source]

MediaWiki version: 1.5

Possibilities are UNKNOWN, BITMAP, DRAWING, AUDIO, VIDEO, MULTIMEDIA, OFFICE, TEXT, EXECUTABLE, and ARCHIVE.

img_major_mime[edit | edit source]

Possibilities are unknown, application, audio, image, text, video, message, model, and multipart.

img_minor_mime[edit | edit source]

E.g. jpeg, gif, png, etc.

img_description[edit | edit source]

Description field given during upload. It's not the description page (associated File: wiki page), but the "summary" provided by the user in case of reupload.

img_user[edit | edit source]

User ID of who uploaded the file.

img_user_text[edit | edit source]

User name of who uploaded the file.

img_timestamp[edit | edit source]

Timestamp of when upload took place.

img_sha1[edit | edit source]

MediaWiki version: 1.11

The SHA-1 hash of the file contents in base 36 format. includes/GlobalFunctions.php's wfBaseConvert is used to convert from base 16 (hexadecimal) to base 36 and then pad the result to 31 characters.

img_type[edit | edit source]

MediaWiki version: 1.4

Removed in v1.5.

Versions[edit | edit source]

MediaWiki version: 1.21


mysql> DESCRIBE image;
+-----------------+--------------------------------------------------------------------------------------------------------+------+-----+---------+-------+
| Field           | Type                                                                                                   | Null | Key | Default | Extra |
+-----------------+--------------------------------------------------------------------------------------------------------+------+-----+---------+-------+
| img_name        | varchar(255)                                                                                           | NO   | PRI |         |       |
| img_size        | int(10) unsigned                                                                                       | NO   | MUL | 0       |       |
| img_width       | int(11)                                                                                                | NO   |     | 0       |       |
| img_height      | int(11)                                                                                                | NO   |     | 0       |       |
| img_metadata    | mediumblob                                                                                             | NO   |     | NULL    |       |
| img_bits        | int(11)                                                                                                | NO   |     | 0       |       |
| img_media_type  | enum('UNKNOWN','BITMAP','DRAWING','AUDIO','VIDEO','MULTIMEDIA','OFFICE','TEXT','EXECUTABLE','ARCHIVE') | YES  | MUL | NULL    |       |
| img_major_mime  | enum('unknown','application','audio','image','text','video','message','model','multipart')             | NO   |     | unknown |       |
| img_minor_mime  | varbinary(100)                                                                                         | NO   |     | unknown |       |
| img_description | tinyblob                                                                                               | NO   |     | NULL    |       |
| img_user        | int(10) unsigned                                                                                       | NO   |     | 0       |       |
| img_user_text   | varchar(255)                                                                                           | NO   | MUL | NULL    |       |
| img_timestamp   | varbinary(14)                                                                                          | NO   | MUL |         |       |
| img_sha1        | varbinary(32)                                                                                          | NO   | MUL |         |       |
+-----------------+--------------------------------------------------------------------------------------------------------+------+-----+---------+-------+
MediaWiki versions: 1.17 – 1.20


mysql> DESCRIBE image;
+-----------------+--------------------------------------------------------------------------------------------------------+------+-----+---------+-------+
| Field           | Type                                                                                                   | Null | Key | Default | Extra |
+-----------------+--------------------------------------------------------------------------------------------------------+------+-----+---------+-------+
| img_name        | varchar(255)                                                                                           | NO   | PRI |         |       |
| img_size        | int(10) unsigned                                                                                       | NO   | MUL | 0       |       |
| img_width       | int(11)                                                                                                | NO   |     | 0       |       |
| img_height      | int(11)                                                                                                | NO   |     | 0       |       |
| img_metadata    | mediumblob                                                                                             | NO   |     | NULL    |       |
| img_bits        | int(11)                                                                                                | NO   |     | 0       |       |
| img_media_type  | enum('UNKNOWN','BITMAP','DRAWING','AUDIO','VIDEO','MULTIMEDIA','OFFICE','TEXT','EXECUTABLE','ARCHIVE') | YES  |     | NULL    |       |
| img_major_mime  | enum('unknown','application','audio','image','text','video','message','model','multipart')             | NO   |     | unknown |       |
| img_minor_mime  | varbinary(100)                                                                                         | NO   |     | unknown |       |
| img_description | tinyblob                                                                                               | NO   |     | NULL    |       |
| img_user        | int(10) unsigned                                                                                       | NO   |     | 0       |       |
| img_user_text   | varchar(255)                                                                                           | NO   | MUL | NULL    |       |
| img_timestamp   | varbinary(14)                                                                                          | NO   | MUL |         |       |
| img_sha1        | varbinary(32)                                                                                          | NO   | MUL |         |       |
+-----------------+--------------------------------------------------------------------------------------------------------+------+-----+---------+-------+


MediaWiki version: 1.12


+-----------------+--------------------------------------------------------------------------------------------------------+------+-----+---------+-------+
| Field           | Type                                                                                                   | Null | Key | Default | Extra |
+-----------------+--------------------------------------------------------------------------------------------------------+------+-----+---------+-------+
| img_name        | varchar(255)                                                                                           | NO   | PRI | NULL    |       |
| img_size        | int(8) unsigned                                                                                        | NO   | MUL | 0       |       |
| img_width       | int(5)                                                                                                 | NO   |     | 0       |       |
| img_height      | int(5)                                                                                                 | NO   |     | 0       |       |
| img_metadata    | mediumblob                                                                                             | NO   |     | NULL    |       |
| img_bits        | int(3)                                                                                                 | NO   |     | 0       |       |
| img_media_type  | enum('UNKNOWN','BITMAP','DRAWING','AUDIO','VIDEO','MULTIMEDIA','OFFICE','TEXT','EXECUTABLE','ARCHIVE') | YES  |     | NULL    |       |
| img_major_mime  | enum('unknown','application','audio','image','text','video','message','model','multipart')             | NO   |     | unknown |       |
| img_minor_mime  | varchar(32)                                                                                            | NO   |     | unknown |       |
| img_description | tinyblob                                                                                               | NO   |     | NULL    |       |
| img_user        | int(5) unsigned                                                                                        | NO   |     | 0       |       |
| img_user_text   | varchar(255)                                                                                           | NO   | MUL | NULL    |       |
| img_timestamp   | char(14)                                                                                               | NO   | MUL | NULL    |       |
| img_sha1        | varbinary(32)                                                                                          | NO   | MUL | NULL    |       |
+-----------------+--------------------------------------------------------------------------------------------------------+------+-----+---------+-------+


MediaWiki version: 1.11
MediaWiki version: 1.10


+-----------------+--------------------------------------------------------------------------------------------------------+------+-----+---------+-------+
| Field           | Type                                                                                                   | Null | Key | Default | Extra |
+-----------------+--------------------------------------------------------------------------------------------------------+------+-----+---------+-------+
| img_name        | varchar(255)                                                                                           | NO   | PRI | NULL    |       |
| img_size        | int(10) unsigned                                                                                       | NO   | MUL | 0       |       |
| img_width       | int(11)                                                                                                | NO   |     | 0       |       |
| img_height      | int(11)                                                                                                | NO   |     | 0       |       |
| img_metadata    | mediumblob                                                                                             | NO   |     | NULL    |       |
| img_bits        | int(11)                                                                                                | NO   |     | 0       |       |
| img_media_type  | enum('UNKNOWN','BITMAP','DRAWING','AUDIO','VIDEO','MULTIMEDIA','OFFICE','TEXT','EXECUTABLE','ARCHIVE') | YES  |     | NULL    |       |
| img_major_mime  | enum('unknown','application','audio','image','text','video','message','model','multipart')             | NO   |     | unknown |       |
| img_minor_mime  | varbinary(32)                                                                                          | NO   |     | unknown |       |
| img_description | tinyblob                                                                                               | NO   |     | NULL    |       |
| img_user        | int(10) unsigned                                                                                       | NO   |     | 0       |       |
| img_user_text   | varchar(255)                                                                                           | NO   | MUL | NULL    |       |
| img_timestamp   | varbinary(14)                                                                                          | NO   | MUL | NULL    |       |
| img_sha1        | varbinary(32)                                                                                          | NO   | MUL | NULL    |       |
+-----------------+--------------------------------------------------------------------------------------------------------+------+-----+---------+-------+
MediaWiki version: 1.9
MediaWiki version: 1.8
MediaWiki version: 1.7
MediaWiki version: 1.6
MediaWiki version: 1.5


+-----------------+--------------------------------------------------------------------------------------------------------+------+-----+---------+-------+
| Field           | Type                                                                                                   | Null | Key | Default | Extra |
+-----------------+--------------------------------------------------------------------------------------------------------+------+-----+---------+-------+
| img_name        | varchar(255)                                                                                           | NO   | PRI | NULL    |       |
| img_size        | int(8) unsigned                                                                                        | NO   | MUL | 0       |       |
| img_width       | int(5)                                                                                                 | NO   |     | 0       |       |
| img_height      | int(5)                                                                                                 | NO   |     | 0       |       |
| img_metadata    | mediumblob                                                                                             | NO   |     | NULL    |       |
| img_bits        | int(3)                                                                                                 | NO   |     | 0       |       |
| img_media_type  | enum('UNKNOWN','BITMAP','DRAWING','AUDIO','VIDEO','MULTIMEDIA','OFFICE','TEXT','EXECUTABLE','ARCHIVE') | YES  |     | NULL    |       |
| img_major_mime  | enum('unknown','application','audio','image','text','video','message','model','multipart')             | NO   |     | unknown |       |
| img_minor_mime  | varchar(32)                                                                                            | NO   |     | unknown |       |
| img_description | tinyblob                                                                                               | NO   |     | NULL    |       |
| img_user        | int(5) unsigned                                                                                        | NO   |     | 0       |       |
| img_user_text   | varchar(255)                                                                                           | NO   |     | NULL    |       |
| img_timestamp   | char(14)                                                                                               | NO   | MUL | NULL    |       |
+-----------------+--------------------------------------------------------------------------------------------------------+------+-----+---------+-------+
MediaWiki version: 1.4


+-----------------+---------------------+------+-----+---------+-------+
| Field           | Type                | Null | Key | Default | Extra |
+-----------------+---------------------+------+-----+---------+-------+
| img_name        | varchar(255) binary |      |     |         |       |
| img_size        | int(8) unsigned     |      |     | 0       |       |
| img_description | tinyblob            |      |     |         |       |
| img_user        | int(5) unsigned     |      |     | 0       |       |
| img_user_text   | varchar(255) binary |      |     |         |       |
| img_timestamp   | varchar(14) binary  |      |     |         |       |
+-----------------+---------------------+------+-----+---------+-------+
Databases Engines: MySQLOraclePostgreSQLSQLite
Technical documentation: Schema (tables) – API property associationsField prefixesPrimary key storage in other fieldsWikimedia extension tables
Configuration: SettingsSharing
Development: AccessOptimizationPolicyUpdaterExtension schema updatesPatch file
Core tables: archivecategorycategorylinkschange_tagconfigexternallinksfilearchivehitcounterimageimagelinksinterwikiiwlinksipblocksjobl10n_cachelanglinkslogginglog_searchmsg_resourcemsg_resource_linksmodule_depsobjectcacheoldimagepagepagelinkspage_propspage_restrictionsprotected_titlesquerycachequerycachetwoquerycache_inforecentchangesredirectrevisionsearchindexsitessite_statstag_summarytemplatelinkstexttranscacheupdateloguploadstashuseruser_former_groupsuser_groupsuser_newtalkuser_propertiesvalid_tagwatchlist
Language: English  • 日本語 • polski