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

Consider removing the custom filearea and reusing the core #16

Open
brendanheywood opened this issue Jun 21, 2020 · 0 comments
Open

Consider removing the custom filearea and reusing the core #16

brendanheywood opened this issue Jun 21, 2020 · 0 comments

Comments

@brendanheywood
Copy link
Collaborator

Core already does image resizing for the image previews. The image previews correctly handle the capability checks already.

https://github.com/moodle/moodle/blob/master/lib/filestorage/file_storage.php#L224-L235

The core sizes eg 'thumb' used by the preview won't work for this plugin, both because they are too small, but also because they are always a square. But as long as the custom size is in the filearea then core will still load it correctly for free:

https://github.com/moodle/moodle/blob/master/lib/filelib.php#L2618-L2621

This will also make is much easier to implement #8 and the remained of #7

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

1 participant