this should be here to stop it using any ext >_<

This commit is contained in:
Daku 2012-02-16 03:03:36 +00:00
parent d33853cee0
commit 78a16885e5

View File

@ -62,6 +62,15 @@ class ResizeImage extends Extension {
global $config; global $config;
$image_obj = Image::by_id($event->image_id); $image_obj = Image::by_id($event->image_id);
if($config->get_bool("resize_upload") == true && ($image_obj->ext == "jpg" || $image_obj->ext == "png" || $image_obj->ext == "gif")){
$width = $height = 0;
if ($config->get_int("resize_default_width") !== 0) {
$height = $config->get_int("resize_default_width");
}
if ($config->get_int("resize_default_height") !== 0) {
$height = $config->get_int("resize_default_height");
}
$isanigif = 0; $isanigif = 0;
if($image_obj->ext == "gif"){ if($image_obj->ext == "gif"){
$image_filename = warehouse_path("images", $image_obj->hash); $image_filename = warehouse_path("images", $image_obj->hash);
@ -73,17 +82,7 @@ class ResizeImage extends Extension {
$isanigif += preg_match_all('#\x00\x21\xF9\x04.{4}\x00(\x2C|\x21)#s', $chunk, $matches); $isanigif += preg_match_all('#\x00\x21\xF9\x04.{4}\x00(\x2C|\x21)#s', $chunk, $matches);
} }
} }
if($isanigif == 0){
if($config->get_bool("resize_upload") == true && ($image_obj->ext == "jpg" || $image_obj->ext == "png" || $isanigif === 0)){
$width = $height = 0;
if ($config->get_int("resize_default_width") !== 0) {
$height = $config->get_int("resize_default_width");
}
if ($config->get_int("resize_default_height") !== 0) {
$height = $config->get_int("resize_default_height");
}
try { try {
$this->resize_image($event->image_id, $width, $height); $this->resize_image($event->image_id, $width, $height);
} catch (ImageResizeException $e) { } catch (ImageResizeException $e) {
@ -99,6 +98,7 @@ class ResizeImage extends Extension {
//TODO: Notify user that image has been resized. //TODO: Notify user that image has been resized.
} }
} }
}
public function onPageRequest(PageRequestEvent $event) { public function onPageRequest(PageRequestEvent $event) {
global $page, $user; global $page, $user;