-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from netlogix/feature/hide-web-images-in-file-a…
…dmin FEATURE: Hide webp files in file list
- Loading branch information
Showing
5 changed files
with
35 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Netlogix\Nximageoptimizer\Fal\Filter; | ||
|
||
use TYPO3\CMS\Core\Resource\Driver\DriverInterface; | ||
use TYPO3\CMS\Core\Resource\Driver\LocalDriver; | ||
|
||
class GeneratedFileNamesFilter | ||
{ | ||
public static function filterGeneratedFiles( | ||
$itemName, | ||
$itemIdentifier, | ||
$parentIdentifier, | ||
array $additionalInformation, | ||
DriverInterface $driverInstance | ||
) { | ||
if (!$driverInstance instanceof LocalDriver) { | ||
return true; | ||
} | ||
if (preg_match('%.+\.(jpe?g|png)\.webp$%i', $itemName)) { | ||
return -1; | ||
} | ||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters