netresearch / t3x-rte_ckeditor_image

Image support in CKEditor for the TYPO3 ecosystem
GNU Affero General Public License v3.0
56 stars 65 forks source link

Image width always 300 #246

Closed Patta closed 1 year ago

Patta commented 1 year ago

Bug description Image width is always 300 px after saving in backend ckeditor. The image selector sets the correct width (image width).

In my example, this html is added to the rte (image of 500 px width): <p><img alt="" data-alt-override="true" data-htmlarea-file-table="sys_file" data-htmlarea-file-uid="41323" data-title-override="true" src="https://www.mysite.localhost/typo3/image/process?token=a2b54c987ce0a54990cb6df7a1a5309d19a0b87c&amp;id=282836" style="height:586px; width:500px" title="" /></p>

Now, save the content. This html is leftover (missing width attribute): <p><img alt="" data-alt-override="true" data-htmlarea-file-table="sys_file" data-htmlarea-file-uid="41323" data-title-override="true" src="/fileadmin/_processed_/9/f/csm_filename_b0e13f3f0d.jpg" style="height:352px; width:300px" /></p>

My sitepackage rte Default.yaml config imports:

imports:
  - { resource: 'EXT:rte_ckeditor/Configuration/RTE/Processing.yaml' }
  - { resource: 'EXT:rte_ckeditor/Configuration/RTE/Editor/Base.yaml' }
  - { resource: 'EXT:rte_ckeditor/Configuration/RTE/Editor/Plugins.yaml' }
  - { resource: 'EXT:rte_ckeditor_image/Configuration/RTE/Plugin.yaml' }

My sitepackage page tsconfig rte image dimension settings:

RTE.default {
    preset = sitepackage

    buttons.image.options.magic {
        maxWidth = 1920
        maxHeight = 1280
    }
}

Expected behavior Images have the same dimensions as set in image browser / image selector after save the content.

Screenshots or logs I have added a temp log function to the core MagicImageService class and the page tsconfig settings are used in MagicImageService class, so the issue seems in rte_ckeditor_image.

Environment

Documentation Have you checked the readme/documentation?

Patta commented 1 year ago

https://github.com/netresearch/t3x-rte_ckeditor_image#maximum-widthheight helps. Content was outside of the root page (news). IMHO the RTE magic image config should be migrated to an own independend config in the future.