Fix full size dimensions after rotating an image on the photo view page.

The photo view page caches the dimensions of the full size and then
renders it in Javascript.  But after rotation, those dimensions are no
longer valid.  Create a new function on the items controller that
returns the appropriate dimensions, then add a hook on
$.gallery_replace_image and implement the hook on the photo view page
to have it make an async call to get the new dimensions.

Fixes ticket #1317
This commit is contained in:
Bharat Mediratta
2010-09-04 15:54:07 -07:00
parent b49d2e6e00
commit c51b6ab38d
3 changed files with 26 additions and 1 deletions
+9
View File
@@ -31,4 +31,13 @@ class Items_Controller extends Controller {
access::required("view", $item);
url::redirect($item->abs_url());
}
// Return the width/height dimensinons for the given item
public function dimensions($id) {
$item = ORM::factory("item", $id);
access::required("view", $item);
json::reply(array("thumb" => array((int)$item->thumb_width, (int)$item->thumb_height),
"resize" => array((int)$item->resize_width, (int)$item->resize_height),
"full" => array((int)$item->width, (int)$item->height)));
}
}