Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-50175

Optimize Moodle Image Files

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.9
    • Fix Version/s: 3.1
    • Component/s: Themes
    • Labels:

      Description

      Using optipng, advancecomp, and jpegoptim I am able to losslessly reduce the size of images in the default Moodle install by about 1388KiB.

      I used the following commands:

      # Optimize PNGs by removing unnecessary data and optimizing filters with optipng then optimizing deflate compression with advdef
      find -path ./lib -prune -o -type f -iname "*.png" -exec optipng -strip all -o7 {} + -exec advdef -z4 -i50 {} +
       
      # Optimize JPEGs by removing unnecessary data and optimizing encoding with jpegoptim
      find -path ./lib -prune -o -type f -iregex ".*\.jpe?g$" -exec jpegoptim --strip-all {} +
      

      I have a commit up on GitHub with the images optimized .

      I shyed away from optimizing /lib because I read another feature enhancement on this tracker where a moodle dev didn't like /lib being modified. Additional gains can probably be had by optimizing that directory as well.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                1 Vote for this issue
                Watchers:
                11 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  23/May/16