diff options
author | mamouneyya <mamoun.diraneyya@gmail.com> | 2010-08-31 18:04:21 +0300 |
---|---|---|
committer | mamouneyya <mamoun.diraneyya@gmail.com> | 2010-08-31 18:04:21 +0300 |
commit | 0b6664e8f9d19df025739bc4a0cf1821563d6b3d (patch) | |
tree | 5b1de2331d4a9d0eb8d97bbb74be6d794d6260a1 /modules/gallery/controllers/quick.php | |
parent | 0a128bab0a788288c5291491a68bd1c9ab432825 (diff) | |
parent | 23d59dec7240dfa4bffe9d88f46a848e76ce0134 (diff) |
Merge remote branch 'gallery3/master'
Diffstat (limited to 'modules/gallery/controllers/quick.php')
-rw-r--r-- | modules/gallery/controllers/quick.php | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/modules/gallery/controllers/quick.php b/modules/gallery/controllers/quick.php index fee601d9..c34209da 100644 --- a/modules/gallery/controllers/quick.php +++ b/modules/gallery/controllers/quick.php @@ -36,25 +36,11 @@ class Quick_Controller extends Controller { } if ($degrees) { - gallery_graphics::rotate($item->file_path(), $item->file_path(), - array("degrees" => $degrees)); - - list($item->width, $item->height) = getimagesize($item->file_path()); - $item->resize_dirty= 1; - $item->thumb_dirty= 1; + $tmpfile = tempnam(TMPPATH, "rotate"); + gallery_graphics::rotate($item->file_path(), $tmpfile, array("degrees" => $degrees)); + $item->set_data_file($tmpfile); $item->save(); - - graphics::generate($item); - - // @todo: this is an inadequate way to regenerate album cover thumbnails after rotation. - foreach (ORM::factory("item") - ->where("album_cover_item_id", "=", $item->id) - ->find_all() as $target) { - copy($item->thumb_path(), $target->thumb_path()); - $target->thumb_width = $item->thumb_width; - $target->thumb_height = $item->thumb_height; - $target->save(); - } + unlink($tmpfile); } if (Input::instance()->get("page_type") == "collection") { |