this should be here to stop it using any ext >_<
This commit is contained in:
parent
d33853cee0
commit
78a16885e5
@ -62,6 +62,15 @@ class ResizeImage extends Extension {
|
||||
global $config;
|
||||
$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;
|
||||
if($image_obj->ext == "gif"){
|
||||
$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);
|
||||
}
|
||||
}
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
if($isanigif == 0){
|
||||
try {
|
||||
$this->resize_image($event->image_id, $width, $height);
|
||||
} catch (ImageResizeException $e) {
|
||||
@ -99,6 +98,7 @@ class ResizeImage extends Extension {
|
||||
//TODO: Notify user that image has been resized.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function onPageRequest(PageRequestEvent $event) {
|
||||
global $page, $user;
|
||||
|
Loading…
x
Reference in New Issue
Block a user