Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto resize image after upload to save space. #830

Closed
farazmunj opened this issue Apr 11, 2014 · 4 comments
Closed

Auto resize image after upload to save space. #830

farazmunj opened this issue Apr 11, 2014 · 4 comments

Comments

@farazmunj
Copy link

Users are uploading big images, need functionality to resize image to small size defined in config. just like creating thumbnail but of actual image.
e.g. all images uploaded using elfinder are reduced to 1200px max with or 1200px max height with ratio maintained

@baconbrad
Copy link

This is a plugin with the 2.1 branch called AutoResize. So if you are doing it put this in your connector $opts. I am writing this without testing so if it isn't right let me know.

    'bind' => array(
        'upload.presave' => array(
            'Plugin.AutoResize.onUpLoadPreSave'
        )
    ),
    'plugin' => array(
        'AutoResize' => array(
        'enable' => true,
        'maxWidth'  => 1200,
        'maxHeight'  => 1200,
        'quality' => 95
        )
    ),

@farazmunj
Copy link
Author

Thanks for help, this solution worked..

@josh18
Copy link

josh18 commented May 15, 2014

Just a note that might help someone in the future, if you are testing the resize function and you are using same image name just make sure you refresh your cache each time you upload the image. This caught me out for awhile.

@afl3307
Copy link

afl3307 commented Nov 1, 2014

Thanks. This works for me too. But i have a diff situation. I would like to only resize the image within /thumbnail, but not /src, how can i config the elfinder to do so? or i have to change the code manually ? I have try adding a if to check the realpath of the upload file before the resize call, however i found that i cannot really get the realpath on the volumn or elfinder object, i can just get the tmp path instead. Could someone know how to do so? Thank you so much.

@lovesia
Copy link

lovesia commented Nov 1, 2014

NAVER - http://www.naver.com/

lovesin83@naver.com 님께 보내신 메일 <Re: [elFinder] Auto resize image after upload to save space. (#830)> 이 다음과 같은 이유로 전송 실패했습니다.


받는 사람이 회원님의 메일을 수신차단 하였습니다.


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants