You need to be logged in to post in the forum - Log In

An active JCE Pro Subscription is required to post in the forum - Buy a Subscription

Support is currently Offline

Official support hours
Monday to Friday
09:00 - 17:00 Europe/London (BST)

Please create a new Ticket and we will get back to you as soon as we can.

#114797 Automatically rename and resize header image

Posted in ‘Editor’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Latest post by stimpy on Tuesday, 03 October 2023 19:44 BST

stimpy
I have an editor that is authorised to publish news articles. We publish multiple articles a week, based on press releases. The senders of the e-mails attach large (2 mb +) photos with names like img39877.jpg or DMC772319.jpg. My editor wants to do things as simple as possible, so he uses the Upload button to upload the image sent. All large images with those cryptic names end up in one large folder. I keep telling him he should use the Select button and and change the filename and resize the image in the upload screen. Either he forgets, is stubborn or just wants to do it the easiest way: upload without thinking.

I already did add a trailing number to the filename, because files were overwritten. (IN a few months we're already at image_74.jpg …)
My question is: is it possible to have the file automatically resized on upload (even if you bypass the upload / select screen) and is it possible to rename the file to the alias of the article.

Ryan
so he uses the Upload button to upload the image sent. All large images with those cryptic names end up in one large folder. I keep telling him he should use the Select button and and change the filename and resize the image in the upload screen.


Are you referring to the Intro Image in the Images & Links tab, or are you inserting the image into the editor window?

Please post a screenshot.

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

stimpy
I am referring to the Images & Links tab. There is a green Select button and beside of it an upload button. My editor uses the upload button, bypassing all option to neatly store, rename and resize a header image.

Ryan
Do you have the latest version of JCE Pro installed? - https://www.joomlacontenteditor.net/downloads/editor/pro/latest

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

stimpy
Yes.

Ryan
My question is: is it possible to have the file automatically resized on upload (even if you bypass the upload / select screen) and is it possible to rename the file to the alias of the article.


The file can't be renamed to the alias of the article, but you can automatically resize it.

In Editor Profiles -> Editor Parameters -> Filesystem, set Upload Resize State to On, and in the Resize box, set at least a Width or Height value.

https://cdn.joomlacontenteditor.net/tmp/114797-automatically-rename-and-resize-header-image.jpg

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

Ryan
You can also use the Random upload file name option (further up on the profile page) to add a randomly generated 5 character string to the end of the file name on upload. This should ensure that a previous file is not overwritten.

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

stimpy
Am I correct it's the Upload Resize State setting that must be turned on? I had already set the image size, but saw that only affected the prefilled settings in the file upload dialogue window.
And a trailing number after the file name was already set with _$.

Ryan
The Upload Resize State basically checks the Resize box in the Upload dialog, but it also sets "Resizing" to be on for all uploads. You could also for example set the Upload Resize State to On and then set Upload Resize Options to No, so Resizing is on, but the user can't change the settings in the Upload dialog.

With Upload Resize State set to On, drag & drop uploads and uploads using the button in the Media Field will all be resized.

And a trailing number after the file name was already set with _$.


I forgot about that option! I'm also looking into further enhancements for the file name, like adding variables like for the File Directory Path.

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

stimpy
Great, it works! :-)

I might suggest adding year-month-day added to the filename.

One last question: the user is now uploading all files to the root images folder. I would like to set it to a specific folder (like stores/year/month/day). That I know how to do, but the user should also be allowed to browse to an other folder in the stories directory and the banners folder. If I just the stores/year/month/day folder, the user seems to get stuck to the current day and isn't allowed to browse anywhere.