version bumps

This commit is contained in:
Shish 2023-05-25 12:57:21 +01:00
parent b5b7fe7d9e
commit 4ba3af7926
6 changed files with 284 additions and 293 deletions

465
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -85,20 +85,20 @@ class Media extends Extension
{
$sb = $event->panel->create_new_block("Media Engines");
// if (self::imagick_available()) {
// try {
// $image = new Imagick(realpath('tests/favicon.png'));
// $image->clear();
// $sb->add_label("ImageMagick detected");
// } catch (ImagickException $e) {
// $sb->add_label("<b style='color:red'>ImageMagick not detected</b>");
// }
// } else {
// if (self::imagick_available()) {
// try {
// $image = new Imagick(realpath('tests/favicon.png'));
// $image->clear();
// $sb->add_label("ImageMagick detected");
// } catch (ImagickException $e) {
// $sb->add_label("<b style='color:red'>ImageMagick not detected</b>");
// }
// } else {
$sb->start_table();
$sb->add_table_header("Commands");
$sb->add_text_option(MediaConfig::CONVERT_PATH, "convert", true);
// }
// }
$sb->add_text_option(MediaConfig::FFMPEG_PATH, "ffmpeg", true);
$sb->add_text_option(MediaConfig::FFPROBE_PATH, "ffprobe", true);
@ -202,8 +202,8 @@ class Media extends Extension
break;
case MediaEngine::IMAGICK:
// if (self::imagick_available()) {
// } else {
// if (self::imagick_available()) {
// } else {
self::image_resize_convert(
$event->input_path,
$event->input_mime,
@ -227,9 +227,9 @@ class Media extends Extension
}
// TODO: Get output optimization tools working better
// if ($config->get_bool("thumb_optim", false)) {
// exec("jpegoptim $outname", $output, $ret);
// }
// if ($config->get_bool("thumb_optim", false)) {
// exec("jpegoptim $outname", $output, $ret);
// }
}
public const CONTENT_SEARCH_TERM_REGEX = "/^content[=|:]((video)|(audio)|(image)|(unknown))$/i";

View File

@ -63,12 +63,12 @@ abstract class VideoCodecs
//
// public static function is_input_supported(string $engine, string $mime): bool
// {
// return MimeType::matches_array(
// $mime,
// MediaEngine::INPUT_SUPPORT[$engine]
// );
// }
//
// public static function is_input_supported(string $engine, string $mime): bool
// {
// return MimeType::matches_array(
// $mime,
// MediaEngine::INPUT_SUPPORT[$engine]
// );
// }
}

View File

@ -251,9 +251,11 @@ class MimeType
$output = MimeType::PPM;
break;
// TODO: There is no uniquely defined Mime type for the cursor format. Need to figure this out.
// case FileExtension::CUR:
// $output = MimeType::CUR;
// break;
/*
case FileExtension::CUR:
$output = MimeType::CUR;
break;
*/
}
}
}

View File

@ -65,37 +65,37 @@ class TranscodeVideo extends Extension
$sb->end_table();
}
/*
public function onDataUpload(DataUploadEvent $event)
{
// global $config;
//
// if ($config->get_bool(TranscodeVideoConfig::UPLOAD) == true) {
// $ext = strtolower($event->type);
//
// $ext = Media::normalize_format($ext);
//
// if ($event->type=="gif"&&Media::is_animated_gif($event->tmpname)) {
// return;
// }
//
// if (in_array($ext, array_values(self::INPUT_FORMATS))) {
// $target_format = $config->get_string(TranscodeVideoConfig::UPLOAD_PREFIX.$ext);
// if (empty($target_format)) {
// return;
// }
// try {
// $new_image = $this->transcode_image($event->tmpname, $ext, $target_format);
// $event->set_tmpname($new_image, Media::determine_ext($target_format));
// } catch (Exception $e) {
// log_error("transcode_video", "Error while performing upload transcode: ".$e->getMessage());
// // We don't want to interfere with the upload process,
// // so if something goes wrong the untranscoded image jsut continues
// }
// }
// }
global $config;
if ($config->get_bool(TranscodeVideoConfig::UPLOAD) == true) {
$ext = strtolower($event->type);
$ext = Media::normalize_format($ext);
if ($event->type=="gif"&&Media::is_animated_gif($event->tmpname)) {
return;
}
if (in_array($ext, array_values(self::INPUT_FORMATS))) {
$target_format = $config->get_string(TranscodeVideoConfig::UPLOAD_PREFIX.$ext);
if (empty($target_format)) {
return;
}
try {
$new_image = $this->transcode_image($event->tmpname, $ext, $target_format);
$event->set_tmpname($new_image, Media::determine_ext($target_format));
} catch (Exception $e) {
log_error("transcode_video", "Error while performing upload transcode: ".$e->getMessage());
// We don't want to interfere with the upload process,
// so if something goes wrong the untranscoded image jsut continues
}
}
}
}
*/
public function onPageRequest(PageRequestEvent $event)
{

View File

@ -9,7 +9,7 @@ class CustomUploadTheme extends UploadTheme
// public function display_block(Page $page) {
// $page->add_block(new Block("Upload", $this->build_upload_block(), "left", 20));
// }
//
//
// public function display_full(Page $page) {
// $page->add_block(new Block("Upload", "Disk nearly full, uploads disabled", "left", 20));
// }