This commit is contained in:
Shish 2019-04-16 20:41:13 +01:00
parent 7abf1aa591
commit 4c70258352
2 changed files with 3 additions and 3 deletions

View File

@ -92,7 +92,7 @@ class PixelFileHandler extends DataHandlerExtension {
$q = $config->get_int("thumb_quality"); $q = $config->get_int("thumb_quality");
$convert = $config->get_string("thumb_convert_path"); $convert = $config->get_string("thumb_convert_path");
// ffff imagemagic fails sometimes, not sure why // ffff imagemagick fails sometimes, not sure why
//$format = "'%s' '%s[0]' -format '%%[fx:w] %%[fx:h]' info:"; //$format = "'%s' '%s[0]' -format '%%[fx:w] %%[fx:h]' info:";
//$cmd = sprintf($format, $convert, $inname); //$cmd = sprintf($format, $convert, $inname);
//$size = shell_exec($cmd); //$size = shell_exec($cmd);
@ -107,7 +107,7 @@ class PixelFileHandler extends DataHandlerExtension {
$cmd = str_replace("\"convert\"", "convert", $cmd); // quotes are only needed if the path to convert contains a space; some other times, quotes break things, see github bug #27 $cmd = str_replace("\"convert\"", "convert", $cmd); // quotes are only needed if the path to convert contains a space; some other times, quotes break things, see github bug #27
exec($cmd, $output, $ret); exec($cmd, $output, $ret);
log_debug('handle_pixel', "Generating thumnail with command `$cmd`, returns $ret"); log_debug('handle_pixel', "Generating thumbnail with command `$cmd`, returns $ret");
if($config->get_bool("thumb_optim", false)) { if($config->get_bool("thumb_optim", false)) {
exec("jpegoptim $outname", $output, $ret); exec("jpegoptim $outname", $output, $ret);

View File

@ -4,7 +4,7 @@
* Author: Shish <webmaster@shishnet.org> * Author: Shish <webmaster@shishnet.org>
* Link: http://code.shishnet.org/shimmie2/ * Link: http://code.shishnet.org/shimmie2/
* License: GPLv2 * License: GPLv2
* Description: Allows the admin to set min / max image dimentions * Description: Allows the admin to set min / max image dimensions
*/ */
class ResolutionLimit extends Extension { class ResolutionLimit extends Extension {
public function get_priority(): int {return 40;} // early, to veto ImageUploadEvent public function get_priority(): int {return 40;} // early, to veto ImageUploadEvent