Explore the core: resize your images upon upload
Wouldn't it be nice to have your images resized upon uploading? Without having to use a third party plugin? Let's explore the core, because Joomla! 4 has this built in. All you need to do is configure it!
A major drawback with Joomla 3 has always been the mediamanager. Thankfully Joomla 4 has a big update in that department. The mediamanager allows for image manipulation such as crop, rotate and resize, multiple uploads and much more. As you have worked with Joomla 4, you must have come across these options allowing for a better workflow.
One of the major reasons however, to install JCE(pro), and use its mediamanager has often been the option to set a resize while uploading. A feature I have used a lot to save tons of space on my clients' websites. For not too tech savvy users this was a lifesaver!
As can be seen above, the default resize option is in place, making it very easy for the user, who does not have to first resize the image prior to uploading it.
I thought this part was still missing in Joomla 4, but I found out it was not! In order for this to work with the Joomla 4 default media manager, you simply need to set your default dimensions in a plugin.
A plugin that is likely already activated, but the fields that control the width and height are not filled yet!
Setting the default resize option
Simply go to “System” - “Plugins” and find the “Media Action - Resize” plugin.
As you can see, it states what it does: Resize functionality for images.
Go to the second tab, and voila, you can set your default image size here! If you for instance set both fields to 1000px, your image will be scaled to that width / height during upload, of course keeping the right aspect ratio.
Click on save and you are good to go. The upload function of your default Joomla 4 website will now resize during upload!
Before and after
Below you can see the result when the plugin is set.
The left image shows the image information that is on my harddrive, the right one shows the image information after upload. As you can see, the dimensions are different, according to my settings in the plugin, and even better, the size is also different.
Simply setting up the plugin will enable you to automatically change the image size during upload. Another great feature and reason to stick to the core!
Some articles published on the Joomla Community Magazine represent the personal opinion or experience of the Author on the specific topic and might not be aligned to the official position of the Joomla Project
By accepting you will be accessing a service provided by a third-party external to https://magazine.joomla.org/
Comments 10
I have tried configuring the image dimensions, following the instructions above and encountered this error when uploading images using the media manager:
Call to undefined function imagecreatefromstring()
What other server configuration do I need to enable?
It appears that your PHP installation might be lacking the GD extension or it might not be enabled. If you have access to your server's extensions, please consider enabling the GD PHP extension. Alternatively, you can get in touch with your web hosting provider and ask them to enable the GD extension for you.
It's important to note that in PHP 8+, the name of the extension has changed from php_gd2.dll to php_gd.dll, without the "2". If you have any user.ini or php.ini files, please modify them accordingly. When using PHP 8, it should be php_gd.dll, not php_gd2.dll.
To verify whether the GD library is enabled, you can create a new file containing the PHP function phpinfo(); and check the PHP information provided.
Ensure that your php.ini file has the necessary line enabled for PHP 8.
Hi Maarten,
Thank you for the response. I will get my VPS admin to verify if the extension has been enabled.
I've tried this on Joomla 4.3.3 but it doesn't seem to work.
I'm using JCE does that matter?
i think it does. this is 'explore the core' so no other components or plugins. just tinyMCE and Joomla! JCE has its own options here.
NOTE: I don't get an error, but when I upload it still has the defaults 640 x 480. Cleared cache, etc.
Thanks for the help.
when uploading a file smaller, it will stay small, when uploading a file bigger, it will resize.
I don't know where to download.
nothing to download, its a plugin that is already available.
Simply go to “System” - “Plugins” and find the “Media Action - Resize” plugin.
Hello, it seems to not be in the version 5 ?