loaded()) { throw new Kohana_404_Exception(); } // Redirect to the more specific resource type, since it will render // differently. We can't delegate here because we may have gotten to this // page via /items/ which means that we don't have a type-specific controller. Also, we // want to drive a single canonical resource mapping where possible. 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))); } }