By Maarten Blokdijk on Thursday, 20 July 2023
Category: July

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!

Leave Comments