asikart / remoteimage

Asikart RemoteImage helps you manage Joomla CMS image and media files on local and remote FTP host.
http://ext.asikart.com/extensions/asikart-remoteimage.html
10 stars 11 forks source link

Autoresize images #14

Closed olive31 closed 9 years ago

olive31 commented 10 years ago

Hi there, first of all congrats for all the good work.

There is a feature that I am missing in your plugin: automatically resizing or trimming uploaded images so that they keep the same ratio but they do not exceed a certain width and/or height.

This is to handle the fact that many users upload huge pictures directly from their cameras whereas the site I am designing is 1200px large. To save space on the server disk, I need to trim their dimension when uploading.

Could you please let me know whether this is an exisiting feature I have missed or if I need to modify the code somewhere. Will be happy to do and send you my modifications but please note that although being an excellent coder, I am a total newbie in Joomla and don't know where to start. I checked a bit and it seems that it should be in the elFinder files you are using. Is this the best way to call the resize function in one of these file for the uploaded files which are of image type ?

Any help would be appreciated.

Best

asika32764 commented 10 years ago

Hi,

I'm glad you like our extension.

About image autoresizing, elFinder has a plugin can do this, see: https://github.com/asikart/remoteimage/tree/staging/admin/src/Elfinder/plugins/AutoResize

But I'm not implement this feature yet, it maybe will be implement if I have time to continue update ARI. If you want to do this yourself, you can modify this file: https://github.com/asikart/remoteimage/blob/staging/admin/src/Remoteimage/Controller/ManagerController.php

However, elFinder's document are not very completed, so I'm not sure whether they write tutorial about autoresizing or not. https://github.com/Studio-42/elFinder/wiki

Hope this information can help you.

Thanks

olive31 commented 10 years ago

Hi there, OK, this one was easy. I have added to RemoteImage the capacity to resize images when uploading. It is also possible to set all the parameters (max height, max height, JPEG recompression quality) in the Joomla config. Do you want the edited code ?

I think that this is a simple but major feature for your remoteImage extension as a lot of Joomla authors now upload huge images (because of cameras high resolution) they would like to shrink automatically.

Hope this helps Cheers

asika32764 commented 10 years ago

Sure, It will be great if you are willing to provide your code, I will consider how to add these code to extension.

Thanks.

olive31 commented 10 years ago

I know I will sound very stupid on a github site but how can I send you the files ? :-) I have no git client or whatsoever, I will put the French translation in the package too ...

asika32764 commented 10 years ago

That's ok, feel free to send any patch to me.

There is a way that you don't need send files or have git client. Just use Github UI to create file. Just follow this way:

Go to the files you want to create

And click the plus icon.

p-2014-07-18-1

Paste your content

p-2014-07-18-2

You will notice that you need a folder, not just put in languages folder, so we type fr-FR/ in file name input. you will see the folder created.

p-2014-07-18-3

p-2014-07-18-4

Then type file name.

p-2014-07-18-5

Save file

Enter some information in bottom input

p-2014-07-18-6

When you save it, Github will create a pull-request and notify repository owner, then when owner accept this pull-request, the file will be store in this repo.

Try it, you can follow these steps to contribute to any project

olive31 commented 10 years ago

Thanks a lot for the help. It is much appreciated !

I branched and uploaded the files (in fr-FR folder as well as the new config.xml and ManagerControler.php files... hope you got notified for all these updates.

Note that the ManagerControler.php contains comment to help you locate my edits... useless with GIT