-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into magicsunday-patch-1
- Loading branch information
Showing
6 changed files
with
101 additions
and
36 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
namespace Netresearch\RteCKEditorImage\Utils; | ||
|
||
use Symfony\Component\Process\Process; | ||
use TYPO3\CMS\Core\Resource\File; | ||
use TYPO3\CMS\Core\Resource\ProcessedFile; | ||
use TYPO3\CMS\Core\Utility\GeneralUtility; | ||
use TYPO3\CMS\Extbase\Service\ImageService; | ||
|
||
class ProcessedFilesHandler | ||
{ | ||
/** | ||
* Create a processed variant of a file based on the given configuration. | ||
* Returns the ProcessedFile or throws an exception if creation failed. | ||
* | ||
* Example for the image configuration: | ||
* $imageConfiguration = [ | ||
* 'width' => '200c', | ||
* 'height' => '200c', | ||
* ]; | ||
* | ||
* @param File $file The file object | ||
* @param array $imageConfiguration The image configuration | ||
* @return ProcessedFile | ||
*/ | ||
public function createProcessedFile(File $file, array $imageConfiguration): ProcessedFile | ||
{ | ||
/** @var ImageService $imageService */ | ||
$imageService = GeneralUtility::makeInstance(ImageService::class); | ||
|
||
// Process the file with the given configuration | ||
try { | ||
return $imageService->applyProcessingInstructions($file, $imageConfiguration); | ||
} catch (\Exception $e) { | ||
throw new \Exception('Could not create processed file', 1716565499); | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
'clearCacheOnLoad' => 0, | ||
'author' => 'Sebastian Koschel', | ||
'author_email' => '[email protected]', | ||
'version' => '12.0.1', | ||
'version' => '12.0.2', | ||
'constraints' => [ | ||
'depends' => [ | ||
'php' => '8.1.0-8.9.99', | ||
|