From: Ævar Arnfjörð Bjarmason Date: Thu, 21 Apr 2005 21:16:12 +0000 (+0000) Subject: * Moving img_exif to img_metadata, makes more sense if we're going to drop X-Git-Tag: 1.5.0alpha1~192 X-Git-Url: https://git.cyclocoop.org/admin/?a=commitdiff_plain;h=03ff01e70b051eaf8c80dee6029e3f0ab84c7786;p=lhc%2Fweb%2Fwiklou.git * Moving img_exif to img_metadata, makes more sense if we're going to drop some metadata for files which do not support exif in there (like Ogg or PNG) --- diff --git a/includes/Image.php b/includes/Image.php index 405213511f..3631a07d15 100644 --- a/includes/Image.php +++ b/includes/Image.php @@ -236,7 +236,7 @@ class Image $dbr =& wfGetDB( DB_SLAVE ); $row = $dbr->selectRow( 'image', - array( 'img_size', 'img_width', 'img_height', 'img_bits', 'img_type' , 'img_exif' ), + array( 'img_size', 'img_width', 'img_height', 'img_bits', 'img_type' , 'img_metadata' ), array( 'img_name' => $this->name ), $fname ); if ( $row ) { $this->fromSharedDirectory = false; @@ -294,7 +294,7 @@ class Image $this->height = $row->img_height; $this->bits = $row->img_bits; $this->type = $row->img_type; - $this->exif = $row->img_exif; + $this->exif = $row->img_metadata; if ( $this->exif == "" ) $this->exif = serialize ( array() ) ; $this->dataLoaded = true; } @@ -342,7 +342,7 @@ class Image 'img_height' => $this->height, 'img_bits' => $this->bits, 'img_type' => $this->type, - 'img_exif' => $this->exif, + 'img_metadata' => $this->exif, ), array( 'img_name' => $this->name ), $fname ); if ( $this->fromSharedDirectory ) { @@ -1015,7 +1015,7 @@ class Image 'img_description' => $desc, 'img_user' => $wgUser->getID(), 'img_user_text' => $wgUser->getName(), - 'img_exif' => $this->exif, + 'img_metadata' => $this->exif, ), $fname, 'IGNORE' ); $descTitle = $this->getTitle(); @@ -1060,7 +1060,7 @@ class Image 'img_user' => $wgUser->getID(), 'img_user_text' => $wgUser->getName(), 'img_description' => $desc, - 'img_exif' => $this->exif, + 'img_metadata' => $this->exif, ), array( /* WHERE */ 'img_name' => $this->name ), $fname @@ -1162,7 +1162,7 @@ class Image # Update EXIF data in database $dbw =& wfGetDB( DB_MASTER ); $dbw->update( '`image`', - array( 'img_exif' => $this->exif ), + array( 'img_metadata' => $this->exif ), array( 'img_name' => $this->name ), $fname ); diff --git a/maintenance/archives/patch-img_metadata.sql b/maintenance/archives/patch-img_metadata.sql new file mode 100644 index 0000000000..aee34c9bef --- /dev/null +++ b/maintenance/archives/patch-img_metadata.sql @@ -0,0 +1,8 @@ +-- Moving img_exif to img_metadata, so the name won't be so confusing when we +-- Use it for Ogg metadata or something like that. + +ALTER TABLE /*$wgDBprefix*/image DROP img_exif; + +ALTER TABLE /*$wgDBprefix*/image ADD ( + img_metadata mediumblob NOT NULL +);