forked from Oksydan/is_themecore
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebp.php
More file actions
17 lines (13 loc) · 746 Bytes
/
webp.php
File metadata and controls
17 lines (13 loc) · 746 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?php
require_once __DIR__ . '/../../config/config.inc.php';
require_once __DIR__ . '/is_themecore.php';
use Oksydan\Module\IsThemeCore\Core\Webp\RelatedImageFileFinder;
use Oksydan\Module\IsThemeCore\Core\Webp\WebpGenerator;
use Oksydan\Module\IsThemeCore\Form\Settings\WebpConfiguration;
$webpGenerator = new WebpGenerator(new RelatedImageFileFinder());
$webpGenerator->setDestinationFile($_GET['source']);
$webpGenerator->setQuality((int) Configuration::get(WebpConfiguration::THEMECORE_WEBP_QUALITY));
$webpGenerator->setConverter(Configuration::get(WebpConfiguration::THEMECORE_WEBP_CONVERTER));
$webpGenerator->setSharpYuv((bool) Configuration::get(WebpConfiguration::THEMECORE_WEBP_SHARPYUV));
$webpGenerator->convertAndServe();
exit;