Resizing a magic image in rte woun't get scaled in frontend
If you insert a magic image in rte and don't touch the image size, you get a downscaled image in frontend.
If you change the size of the image in the rte to a bigger one, the image don't get scaled in frontend, but has the original size.
#1 Updated by Patrick Broens almost 7 years ago
- Complexity set to easy
1) If you insert a magic image in rte and don't touch the image size, you get a downscaled image in frontend.
I did not test this, but isn't the maxWInText setting in the constant editor responsible for this?
2) If you change the size of the image in the rte to a bigger one, the image don't get scaled in frontend, but has the original size.
I think this is the wanted behaviour since you don't want an image to be scaled larger than its original. But I'm not sure.
#2 Updated by Marc Bastian Heinrichs over 6 years ago
Sorry, I described this not exact enough.
The original image e.g. is 3000x2000px.
If you insert a magic image in rte it has a default size, e.g. 600x400px.
If don't touch this default image size, you get a downscaled image (600x400px) in frontend.
If you change the size of the image in the rte to a bigger one, e.g. 900x600px, the image don't get scaled to 900x600px in frontend, but has the original size which is 3000x2000px in this example.
#9 Updated by Björn Haverland over 5 years ago
I have had the same problem with Typo3 6.2. There is a default configuration of the max image width ($magicImageMaximumWidth) in the TYPO3\CMS\Core\Resource\Service\MagicImageService with a default value of 300. It is possible to change this value in your PagsTSConfig.
buttons.image.options.magic.maxWidth = 1000
buttons.image.options.magic.maxHeight = 1000
#10 Updated by Patrick Kroog over 5 years ago
It seems, in FrontEnd a wrong configuration array is passed to
So changing "RTE.default.buttons.image.options.magic.maxWidth" works in Backend, but in FrontEnd it defaults to max. 300px width + 1000px height...
For a working solution in FRONT + BACK-end, i need to add this configuration at the moment (TYPO3 6.2.3):
RTE.default.buttons.image.options.magic.maxWidth = 770
RTE.default.buttons.image.options.magic.maxHeight = 2000
RTE.default.buttons.image.options.plain.maxWidth = 770
RTE.default.buttons.image.options.plain.maxHeight = 2000
RTE.buttons.image < RTE.default.buttons.image
#11 Updated by Fabien Udriot almost 5 years ago
I had the same problem and comment above led me to the right direction. Notice, I was loading the TSConfig via the programmatic way in ext_tables.php which was working for images dimension in the backend but not on the frontend. So, I had to revert and includes as "INCLUDE_TYPOSCRIPT" in the page properties.
# Add page TSConfig (which does not work in the context of the FE) $pageTsConfig = \TYPO3\CMS\Core\Utility\GeneralUtility::getUrl( \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'Configuration/TsConfig/Page/config.ts' ); \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig($pageTsConfig);
UPDATE: It looks this configuration is sufficient
buttons.image.options.magic.maxWidth = 600 if set in the Page TSConfig on the page property (in the database). If put as external TSConfig,
RTE.buttons.image < RTE.default.buttons.image was required for me.