Index: trunk/phase3/maintenance/archives/patch-oi_metadata.sql |
— | — | @@ -0,0 +1,15 @@ |
| 2 | +--
|
| 3 | +-- patch-indexes.sql
|
| 4 | +--
|
| 5 | +-- Add data to allow for direct reference to old images
|
| 6 | +-- They can be included into pages
|
| 7 | +--
|
| 8 | +
|
| 9 | +ALTER TABLE /*$wgDBprefix*/oldimage
|
| 10 | + DROP INDEX oi_name,
|
| 11 | + ADD INDEX oi_name_timestamp (oi_name,oi_timestamp),
|
| 12 | + ADD oi_metadata mediumblob NOT NULL,
|
| 13 | + ADD oi_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL,
|
| 14 | + ADD oi_major_mime ENUM("unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart") NOT NULL default "unknown",
|
| 15 | + ADD oi_minor_mime varchar(32) NOT NULL default "unknown",
|
| 16 | + ADD oi_deleted tinyint(1) unsigned NOT NULL default '0', |
\ No newline at end of file |
Index: trunk/phase3/maintenance/updaters.inc |
— | — | @@ -76,6 +76,7 @@ |
77 | 77 | array( 'archive', 'ar_len', 'patch-ar_len.sql' ), |
78 | 78 | array( 'revision', 'rev_parent_id', 'patch-rev_parent_id.sql' ), |
79 | 79 | array( 'page_restrictions', 'pr_id', 'patch-page_restrictions_sortkey.sql' ), |
| 80 | + array( 'oldimage', 'oi_metadata', 'patch-oi_metadata.sql' ), |
80 | 81 | ); |
81 | 82 | |
82 | 83 | function rename_table( $from, $to, $patch ) { |
Index: trunk/phase3/maintenance/rebuildImages.php |
— | — | @@ -144,7 +144,7 @@ |
145 | 145 | } |
146 | 146 | |
147 | 147 | function oldimageCallback( $row ) { |
148 | | - if( $row->oi_width ) { |
| 148 | + if( $row->oi_width && $row->oi_media_type ) { |
149 | 149 | return null; |
150 | 150 | } |
151 | 151 | |
— | — | @@ -153,7 +153,11 @@ |
154 | 154 | return array( |
155 | 155 | 'oi_width' => $info['width' ], |
156 | 156 | 'oi_height' => $info['height'], |
157 | | - 'oi_bits' => $info['bits' ] ); |
| 157 | + 'oi_bits' => $info['bits' ], |
| 158 | + 'oi_metadata' => '', // filled in on-demand |
| 159 | + 'oi_media_type' => $info['media'], |
| 160 | + 'oi_major_mime' => $info['major'], |
| 161 | + 'oi_minor_mime' => $info['minor'] ); |
158 | 162 | } |
159 | 163 | |
160 | 164 | function crawlMissing() { |
Index: trunk/phase3/maintenance/tables.sql |
— | — | @@ -715,6 +715,21 @@ |
716 | 716 | oi_user int(5) unsigned NOT NULL default '0', |
717 | 717 | oi_user_text varchar(255) binary NOT NULL, |
718 | 718 | oi_timestamp char(14) binary NOT NULL default '', |
| 719 | + |
| 720 | + -- Extracted EXIF metadata stored as a serialized PHP array. |
| 721 | + oi_metadata mediumblob NOT NULL, |
| 722 | + -- Media type as defined by the MEDIATYPE_xxx constants |
| 723 | + oi_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL, |
| 724 | + -- major part of a MIME media type as defined by IANA |
| 725 | + -- see http://www.iana.org/assignments/media-types/ |
| 726 | + oi_major_mime ENUM("unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart") NOT NULL default "unknown", |
| 727 | + -- minor part of a MIME media type as defined by IANA |
| 728 | + -- the minor parts are not required to adher to any standard |
| 729 | + -- but should be consistent throughout the database |
| 730 | + -- see http://www.iana.org/assignments/media-types/ |
| 731 | + oi_minor_mime varchar(32) NOT NULL default "unknown", |
| 732 | + |
| 733 | + oi_deleted tinyint(1) unsigned NOT NULL default '0', |
719 | 734 | |
720 | 735 | INDEX oi_name (oi_name(10)) |
721 | 736 | |