Resizing of course images

Resizing of course images

by stefan weber -
Number of replies: 6

A frequent problem we are having is that teachers upload huge course images, and then the Dashboard page has to load multiple MB of images when displaying course cards.

Moodle already has a system for generating different sizes of images, used for user profile pictures.

The idea would be to extend this system to course images, so that they can be served in a size appropriate to course cards.

In reply to stefan weber

Re: Resizing of course images

by Guy Thomas -
Brilliant idea and easy to achieve (I think)
In reply to Guy Thomas

Re: Resizing of course images

by Alexander Bias -
Guy, isn't your plugin https://moodle.org/plugins/filter_imageopt already the solution for this requirement?
Sorry for my half knowledge as I do not have this plugin in production, but I remember that you built for this purpose. Maybe it just needs an update for current Moodle versions and some improvements.
In reply to Alexander Bias

Re: Resizing of course images

by Niels Gandraß -
I'd also be interested into implementing a proper and sustainable core solution for this.

While Guys plugin already solves part of the problem, as far as I can see at the moment, the filter only created a second optimized copy of the image but does not resize the original image itself during upload. This way the various 8k 100% quality >20 MB JPEGs from our beloved professors would still bloat up the Moodle data storage and especially exported .mbz files, right?
In reply to Niels Gandraß

Re: Resizing of course images

by Guy Thomas -
@Alex, sorry for my slow reply.
@Niels, you are correct - the reason I implemented it this way was for the plugin to be non-destructive - i.e. you can switch the filter off and see the pictures as they were originally. Of course, the filter could be modified so that it replaces the original images (controlled by a setting). As for resizing course images, my plugin only resizes user content that passes through the filter. So a plugin still might need to be created to achieve this.
In reply to Guy Thomas

Re: Resizing of course images

by Julia Lee -
Hallo Stefan,

I would rate this issue with 10 from 10 points.

Best regards,
Julia
In reply to stefan weber

Re: Resizing of course images

by Gisela Prey -
Hi Stefan,
I understand your concern. We’ve addressed this by not allowing teachers to upload their own images at all.
However, if a solution becomes available, we would consider using it to give teachers more flexibility.
Greetings Gisela