?
avatar brianteeman
brianteeman
1 Dec 2019

In the media manager you can crop and resize images. The selector for this is restrained to the actual image. you can not select the container (the checked area)
image

If you try to use the crop and resize functionality in the template manager the restraints do not apply and you can select anything
image

This will result in an image as below
image

avatar brianteeman brianteeman - open - 1 Dec 2019
avatar joomla-cms-bot joomla-cms-bot - labeled - 1 Dec 2019
avatar joomla-cms-bot joomla-cms-bot - change - 1 Dec 2019
Labels Added: ?
avatar dgrammatiko
dgrammatiko - comment - 9 Dec 2019

@brianteeman I don't think that we're doing anything different than the demo of the used script: https://fengyuanchen.github.io/cropperjs/

To patch this someone needs to dig into the options of that script and if the functionality is not available then restrict the area by some own code (I think we can interfere in the process)

avatar brianteeman
brianteeman - comment - 11 Dec 2019

@dgrammatiko its actually simpler than that.
The settings for cropperjs are in the media-action plugin and com_media uses the media-action plugin

However com_templates is simply loading the cropperjs files directly and not using the plugin :(
So presumably instead of doing that com_template should be doing
PluginHelper::importPlugin('media-action');

Someone better than me can dig in and resolve that. I've done the hard detective work

avatar dgrammatiko
dgrammatiko - comment - 12 Dec 2019

I had to dig in the history and what I found is that the functionality is the same as what exists in the J3.x. I did the ES6 renaming/changes and Charlie did the initial clean up of the file. The functionality was never questioned by either of us, I guess because we didn't encounter this case (?) https://github.com/joomla/joomla-cms/pull/15449/files#diff-3e83167bf7041bbf0b6294e5e132e9fdR106-R125

Anyways changing the initialisation options for the cropperjs should be sufficient to also cover this case

avatar brianteeman
brianteeman - comment - 13 Dec 2019

Anyways changing the initialisation options for the cropperjs should be sufficient to also cover this case

Are you able to do that please

avatar dgrammatiko
dgrammatiko - comment - 13 Dec 2019

Ok I’ll try to do a PR this weekend

avatar brianteeman
brianteeman - comment - 13 Dec 2019

Thank you

avatar alikon alikon - change - 13 Dec 2019
Status New Closed
Closed_Date 0000-00-00 00:00:00 2019-12-13 13:56:16
Closed_By alikon
avatar joomla-cms-bot joomla-cms-bot - change - 13 Dec 2019
Closed_Date 2019-12-13 13:56:16 2019-12-13 13:56:17
Closed_By alikon joomla-cms-bot
avatar joomla-cms-bot joomla-cms-bot - close - 13 Dec 2019
avatar joomla-cms-bot
joomla-cms-bot - comment - 13 Dec 2019

Set to "closed" on behalf of @alikon by The JTracker Application at issues.joomla.org/joomla-cms/27192

avatar alikon
alikon - comment - 13 Dec 2019

please test #27255


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/27192.

Add a Comment

Login with GitHub to post a comment