diff --git a/Classes/Xclass/ImageService.php b/Classes/Xclass/ImageService.php new file mode 100644 index 0000000..95a2274 --- /dev/null +++ b/Classes/Xclass/ImageService.php @@ -0,0 +1,19 @@ +hasProperty('tx_imagejack_excluded') && $image->getProperty('tx_imagejack_excluded') === 1) { + $processingInstructions['tx_imagejack_excluded'] = true; + } + } + return parent::applyProcessingInstructions($image, $processingInstructions); + } +} diff --git a/Configuration/TCA/Overrides/sys_file_reference.php b/Configuration/TCA/Overrides/sys_file_reference.php new file mode 100644 index 0000000..9f99a2d --- /dev/null +++ b/Configuration/TCA/Overrides/sys_file_reference.php @@ -0,0 +1,36 @@ + [ + 'exclude' => true, + 'label' => 'LLL:EXT:image_jack/Resources/Private/Language/backend.xlf:sys_file_reference.tx_imagejack_excluded', + 'config' => [ + 'type' => 'check', + 'renderType' => 'checkboxToggle', + 'default' => 0 + ], + ] +]; + +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('sys_file_reference', $newFields); +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addFieldsToPalette( + 'sys_file_reference', + 'imagejackPalette', + 'tx_imagejack_excluded' +); +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes( + 'sys_file_reference', + '--palette--;;imagejackPalette', + \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE +); + +if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('news')) { + \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addFieldsToPalette( + 'sys_file_reference', + 'imageoverlayPalette', + '--linebreak--,tx_imagejack_excluded', + 'after:crop' + ); +} diff --git a/Resources/Private/Language/backend.xlf b/Resources/Private/Language/backend.xlf new file mode 100644 index 0000000..9cd563a --- /dev/null +++ b/Resources/Private/Language/backend.xlf @@ -0,0 +1,11 @@ + + + +
+ + + Exclude from image_jack processing + + + + diff --git a/ext_localconf.php b/ext_localconf.php index 057f088..02e4f25 100755 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -7,6 +7,7 @@ use Sitegeist\ImageJack\Templates\WebpTemplate; use Sitegeist\ImageJack\Templates\AvifTemplate; use Sitegeist\ImageJack\Xclass\AmazonS3Driver; +use Sitegeist\ImageJack\Xclass\ImageService; use Sitegeist\ImageJack\Xclass\LocalDriver; use TYPO3\CMS\Core\Log\Writer\FileWriter; @@ -57,4 +58,8 @@ $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['createHashBase'][] = TsfeHook::class . '->postProcessHashBase'; } + + $GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][\TYPO3\CMS\Extbase\Service\ImageService::class] = [ + 'className' => ImageService::class + ]; }); diff --git a/ext_tables.sql b/ext_tables.sql index 3b7e929..845a322 100644 --- a/ext_tables.sql +++ b/ext_tables.sql @@ -2,3 +2,8 @@ CREATE TABLE sys_file_processedfile ( tx_imagejack_processed int(11) DEFAULT '0' NOT NULL ); + +CREATE TABLE sys_file_reference +( + tx_imagejack_excluded int(11) DEFAULT '0' NOT NULL +);