#332 Posted in ‘Econa’

Latest post by Lefteris Kavadas on Tuesday, 12 February 2019 12:25 EET

Spacefuel
Hi,

Currently all images are saved to the root path after resizing. But if I have already uploaded the image to a subfolder, then as a result I get 3 images - the original in the subfolder and two images (intro and the full article) in the root folder of the images.
Is it possible to change the default path for resized images to save them in the same folder as the original image?

Kind regards

Lefteris Kavadas
Hi,

Can you please provide more details? Are you using Econa as a custom field? Econa has it's own folders for managing the files. Currently there is no option for changing the upload path.

Regards

Spacefuel
Hi Lefteris,
I'm using Econa in articles intro/full images.
When I choose already uploaded image from the web server (subfolder in /images folder), and crop it, the result image place to /images root folder.
As a result I have 2 additional images in the images root folder for each image that I used for an article.
Now my images folder looks like a trash been.

Kind regards

Lefteris Kavadas
This is just an assumption. Other users may have used the selected image in a different article and deleting it will result to broken page. We have chosen to go the safe way to avoid this.
Any ideas are welcome.

Regards

Spacefuel
Hi,
The best way to solve this issue is to save the cropped images in the same folder as the source file.
It is also more appropriate to add a suffix to the file name, rather than storing it in unknown folders.

Kind regards

Lefteris Kavadas
It's not a random folder. It's the save path you have specified in the core media manager. Econa reads the path and stores the images there. Regarding the suffix, this is how it works right now, but it only adds it if the file exists.
We will think a way for better structure so the root media folder does not get messy.

Regards

Lefteris Kavadas
I am thinking to implement the following structure for storing images:

/MEDIA_ROOT/econa-article-images/ARTICLE_ID/intro/FILENAME
/MEDIA_ROOT/econa-article-images/ARTICLE_ID/full/FILENAME

What do you think? Note that the MEDIA_ROOT is what you define in the core media manager.

Regards

Spacefuel
Hi,

Now it works like this.
If images root folder is "/images" and I choose the already uploaded file /images/stories/apple.jpg and than crop it, the plugin place the result file to /images folder.
But the cropped file must be placed in /images/stories/ folder.

So I thing it will be fine if
for already uploaded files
/MEDIA_ROOT/relative_path_to_file/econa-article-images/intro/FILENAME_ARTICLE_ID
/MEDIA_ROOT/relative_path_to_file/econa-article-images/full/FILENAME_ARTICLE_ID

for files cropped on the fly
/MEDIA_ROOT/econa-article-images/intro/FILENAME_ARTICLE_ID
/MEDIA_ROOT/econa-article-images/full/FILENAME_ARTICLE_ID

Kind Regards

Lefteris Kavadas
I don't like the idea of having different paths depending on the image source.
Also appending the article ID to the filename will result to a single folder with a huge number of files. So adding the article ID as a folder will make things more clear. It will also make it easy if we want to delete the images of a specific article.

Regards

Spacefuel
Hi Lefteris,

Could you tell me what I have to fix in the plugin to save the cropped images in the same folder as the original file?

Kind regards

Lefteris Kavadas
It's not that easy. I recommend to expect the update which will come out very soon. It will use the following storage pattern for the article images plugin:

/MEDIA_ROOT/econa-article-images/ARTICLE_ID/intro/FILENAME
/MEDIA_ROOT/econa-article-images/ARTICLE_ID/full/FILENAME

Regards

Note: An active subscription is required in order to get support for our paid extensions. For our free extensions, if you don't have an account, register and then submit your support request.  In case you just want to ask a question, you can also use the contact form .

Firecoders
Are you using our extensions? Please post a review at the Joomla extensions directory!
Post a review