Keyword

K2 Media manager- Crop and resize presets

More
4 weeks 8 hours ago #177336 by Tom
Hi,

how can I edit crop and resize presets in K2 media manager? Now there are 320x240, 400x400 and so on, I wolud like to add my own presets.

Thank you!

Please Log in or Create an account to join the conversation.

  • Fotis
  • Fotis's Avatar
  • Away
  • Administrator
  • JoomlaWorks Support Team
More
4 weeks 4 hours ago #177340 by Fotis
Replied by Fotis on topic K2 Media manager- Crop and resize presets
Edit the file /media/k2/assets/vendors/studio-42/elfinder/js/elfinder.min.js and search for the text:
presetSize:[[320,240],[400,400],[640,480],[800,600]]

Carefully update that JS array to your new size options. E.g. to add 900x600, change the above to this:
presetSize:[[320,240],[400,400],[640,480],[800,600],[900,600]]

If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

Please Log in or Create an account to join the conversation.

  • Fotis
  • Fotis's Avatar
  • Away
  • Administrator
  • JoomlaWorks Support Team
More
4 weeks 3 hours ago - 4 weeks 3 hours ago #177341 by Fotis
Replied by Fotis on topic K2 Media manager- Crop and resize presets
Actually, I believe you can override this on the elFinder initializer...

Edit the file: /administrator/components/com_k2/views/media/tmpl/default.php

And right after:
                url: '<?php echo JURI::base(true); ?>/index.php?option=com_k2&view=media&task=connector',

add this:
                commandsOptions : {
                    resize: {
                        presetSize : [
                            [100, 100],
                            [320, 240],
                            [400, 400],
                            [640, 480],
                            [800, 600],
                            [900, 600]
                        ]
                    }
                },

Save the file and check the Media Manager for the newly added 100x100 (first in the array) and 900x600 dimension (last in the array). Similarly add your own dimensions or edit the existing ones.

P.S. Under the "Crop" option, if any of your defined dimensions is bigger than the actual image's dimensions, they won't be shown. This is intentional.

If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member
Last edit: 4 weeks 3 hours ago by Fotis. Reason: Fix config syntax, add crop dimensions as well

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum