Bug #45478

Resizing a magic image in rte woun't get scaled in frontend

Added by Marc Bastian Heinrichs almost 7 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Should have
Category:
RTE (rtehtmlarea + ckeditor)
Target version:
-
Start date:
2013-02-14
Due date:
% Done:

0%

TYPO3 Version:
6.0
PHP Version:
Tags:
Complexity:
easy
Is Regression:
No
Sprint Focus:

Description

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.

History

#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.

#3 Updated by Zbigniew Jacko almost 6 years ago

In 6.2 seems to work.

#4 Updated by Ernesto Baschny almost 6 years ago

  • Status changed from New to Needs Feedback
  • Is Regression set to No

@Ma-Ba, could you please re-check? Thanks!

#5 Updated by Marc Bastian Heinrichs over 5 years ago

  • Assignee set to Marc Bastian Heinrichs

#6 Updated by Marc Bastian Heinrichs over 5 years ago

It get scaled now, but it's not possible to get a bigger size than 300px width, also when I raise maxWInText. Will recheck again.

#7 Updated by Alexander Opitz over 5 years ago

  • Status changed from Needs Feedback to New

#8 Updated by Visay Keo over 5 years ago

I'm having the same problem with TYPO3 6.1 and would be good if this could be fixed soon ;-)

#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.

RTE.default {
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

TYPO3\CMS\Core\Resource\Service\MagicImageService::setMagicImageMaximumDimensions

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.

#12 Updated by Patrick Kroog almost 5 years ago

Fabien: For me the same problem occurs, if RTE.default.buttons.image is set within the page properties. (TYPO3 6.2.6).

#13 Updated by Mathias Schreiber about 2 years ago

  • Status changed from New to Closed

HTMLArea is no longer supported by TYPO3.
You can open up new issues here https://github.com/FriendsOfTYPO3/rtehtmlarea.

Cheers
Mathias

Also available in: Atom PDF