artgris / FileManagerBundle

FileManager is a simple Multilingual File Manager Bundle for Symfony
MIT License
171 stars 89 forks source link

Client side crop image #51

Closed arnauddoub closed 4 years ago

arnauddoub commented 4 years ago

Hello, on the readme in the feature i see "File Upload widget used : blueimp/jQuery-File-Upload" with "Client-side image resizing/crop" but when i edit a file to the filemanager i dont have this interface https://blueimp.github.io/jQuery-File-Upload/ . Is it possible to have it ?

artgris commented 4 years ago

Hi @ArnaudDoubremelle,

This feature is not integrated (it's an error in the readme), but I guess it's possible by overriding the bundle templates (manager.html.twig): https://symfony.com/doc/current/bundles/override.html#templates

But, If you need to resize an image, you can do this in the configuration:

conf:
    default:
        dir: "../public/uploads/"
        type: image
        upload:
            image_versions: {'': {max_width: 100, max_height: 100}}

or crop an image:

conf:
    default:
        dir: "../public/uploads/"
        type: image
        upload:
            image_versions: {'': {crop: true, max_width: 10, max_height: 10}}