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

Save user images as JPEG if uploaded in that format.

XMLWordPrintable

    • MOODLE_27_STABLE, MOODLE_28_STABLE, MOODLE_29_STABLE
    • MOODLE_29_STABLE
    • MDL-46763_keep_jpg_avatars_as_jpg
    • Hide

      Testing instructions:

      Testing instructions (Firefox required)

      1. Edit current user profile
      2. Upload jpeg image to user picture
      3. Save profile
      4. Confirm that user picture (avatar) has changed
      5. Hover over image and right hand click and select 'View Image Info'

      Expected: 'Type' should read 'JPEG Image'

      6. Edit current user profile
      7. Upload png image to user picture
      8. Save profile
      9. Confirm that user picture (avatar) has changed
      10. Hover over image and right hand click and select 'View Image Info'

      Expected: 'Type' should read 'PNG Image'

      Show
      Testing instructions: Testing instructions (Firefox required) 1. Edit current user profile 2. Upload jpeg image to user picture 3. Save profile 4. Confirm that user picture (avatar) has changed 5. Hover over image and right hand click and select 'View Image Info' Expected: 'Type' should read 'JPEG Image' 6. Edit current user profile 7. Upload png image to user picture 8. Save profile 9. Confirm that user picture (avatar) has changed 10. Hover over image and right hand click and select 'View Image Info' Expected: 'Type' should read 'PNG Image'

      Moodle supports user icons in both PNG and JPEG format, depending on how the server is set up.

      Currently if both are available everything is saved as PNG.

      The size of most user images could probably be drastically reduced if JPEG was the default instead since it's much better than PNG for "photographic" style images.

      A quick test suggests the user images could be 2 or 3 times smaller than they are now.

      Some images aren't well suited to JPEG compression though and require the lossless compression of PNG. A good rule of thumb would be to save images uploaded as PNG (or GIF) as PNG, and those uploaded as JPEG as JPEG.

      When looking at this code I noticed the default quality for JPEG is set to 90, which, assuming the number means what I think it means, is quite high. Possibly tweaking that downwards would be a good idea too.

            brudinie guy thomas
            bawjaws David Scotson
            Dan Poltawski Dan Poltawski
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Marina Glancy Marina Glancy
            Votes:
            2 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.