Add X13 WebP module for image conversion to next-generation formats
- Implemented the X13Webp class with core functionalities for converting images to WebP format. - Added support for different PHP versions and defined constants for versioning. - Included translation strings for various user interface elements and messages. - Created XML file for module versioning.
This commit is contained in:
13
modules/x13webp/override/classes/ImageManager.php
Normal file
13
modules/x13webp/override/classes/ImageManager.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
class ImageManager extends ImageManagerCore {
|
||||
|
||||
public static function resize($src_file, $dst_file, $dst_width = null, $dst_height = null, $file_type = 'jpg', $force_type = false, &$error = 0, &$targetWidth = null, &$targetHeight = null, $quality = 5, &$sourceWidth = null, &$sourceHeight = null){
|
||||
|
||||
$parent = parent::resize($src_file, $dst_file, $dst_width, $dst_height, $file_type, $force_type, $error, $targetWidth, $targetHeight, $quality, $sourceWidth, $sourceHeight);
|
||||
Hook::exec('actionOnImageResizeAfter', ['dst_file' => $dst_file, 'file_type' => $file_type]);
|
||||
return $parent;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
class FrontController extends FrontControllerCore
|
||||
{
|
||||
|
||||
public function smartyOutputContent($content)
|
||||
{
|
||||
ob_start();
|
||||
parent::smartyOutputContent($content);
|
||||
$html = ob_get_contents();
|
||||
ob_clean();
|
||||
Hook::exec('actionOutputHTMLBefore', array('html' => &$html));
|
||||
echo $html;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user