mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-08-04 14:11:01 -04:00
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:
@@ -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)));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user