diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2010-01-11 10:42:39 -0800 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2010-01-11 10:42:39 -0800 |
commit | 3ab6c4915aa0c9dbd2061ffcad0af00e2c50136e (patch) | |
tree | 2197decd40621162ae82248b7f55c8e8da82a64f | |
parent | a11bf295078656612603c1c561e9261555d0c40c (diff) |
Fixes ticket #671.
In the graphics_rules table height and width set the maximum height and width
values and should be equal. Initially, the height on the resize target rule was
less than the height, which artificially constrained images in portrait mode.
**Note"" this fix requires an upgrade to version 22. All the resizes will be flagged
dirty.
-rw-r--r-- | installer/install.sql | 2 | ||||
-rw-r--r-- | modules/gallery/helpers/gallery_installer.php | 19 | ||||
-rw-r--r-- | modules/gallery/module.info | 2 |
3 files changed, 20 insertions, 3 deletions
diff --git a/installer/install.sql b/installer/install.sql index 6e7c06a2..95a57d86 100644 --- a/installer/install.sql +++ b/installer/install.sql @@ -89,7 +89,7 @@ CREATE TABLE {graphics_rules} ( ) AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; SET character_set_client = @saved_cs_client; INSERT INTO {graphics_rules} VALUES (1,1,'a:3:{s:5:\"width\";i:200;s:6:\"height\";i:200;s:6:\"master\";i:2;}','gallery','gallery_graphics::resize',100,'thumb'); -INSERT INTO {graphics_rules} VALUES (2,1,'a:3:{s:5:\"width\";i:640;s:6:\"height\";i:480;s:6:\"master\";i:2;}','gallery','gallery_graphics::resize',100,'resize'); +INSERT INTO {graphics_rules} VALUES (2,1,'a:3:{s:5:\"width\";i:640;s:6:\"height\";i:640;s:6:\"master\";i:2;}','gallery','gallery_graphics::resize',100,'resize'); DROP TABLE IF EXISTS {groups}; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; diff --git a/modules/gallery/helpers/gallery_installer.php b/modules/gallery/helpers/gallery_installer.php index 410b6413..02ce1b18 100644 --- a/modules/gallery/helpers/gallery_installer.php +++ b/modules/gallery/helpers/gallery_installer.php @@ -240,7 +240,7 @@ class gallery_installer { 100); graphics::add_rule( "gallery", "resize", "gallery_graphics::resize", - array("width" => 640, "height" => 480, "master" => Image::AUTO), + array("width" => 640, "height" => 640, "master" => Image::AUTO), 100); // Instantiate default themes (site and admin) @@ -440,6 +440,23 @@ class gallery_installer { module::set_var("gallery", "simultaneous_upload_limit", 5); module::set_version("gallery", $version = 21); } + + // Update the graphics rules table so that the maximum height for resizes is 640 not 480. + // Fixes ticket #671 + if ( $version == 21) { + $resize_rule = ORM::factory("graphics_rule") + ->where("id", "=", "2") + ->find(); + // make sure it hasn't been changed already + $args = unserialize($resize_rule->args); + if ($args["height"] == 480 && $args["width"] == 640) { + $args["height"] = 640; + $resize_rule->args = serialize($args); + $resize_rule->save(); + graphics::mark_dirty(false, true); + } + module::set_version("gallery", $version = 22); + } } static function uninstall() { diff --git a/modules/gallery/module.info b/modules/gallery/module.info index b3366f7d..107d9a12 100644 --- a/modules/gallery/module.info +++ b/modules/gallery/module.info @@ -1,4 +1,4 @@ name = "Gallery 3" description = "Gallery core application" -version = 21 +version = 22 |