Keyword

K2 Media manager- Crop and resize presets

More
4 years 3 weeks 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.

More
4 years 3 weeks ago #177340 by JoomlaWorks
Replied by JoomlaWorks 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]]

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

More
4 years 3 weeks ago - 4 years 3 weeks ago #177341 by JoomlaWorks
Replied by JoomlaWorks 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.

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Last edit: 4 years 3 weeks ago by JoomlaWorks. Reason: Fix config syntax, add crop dimensions as well

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


Powered by Kunena Forum