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

Generating thumbnails taking too much memory on large images

XMLWordPrintable

    • MOODLE_28_STABLE, MOODLE_29_STABLE, MOODLE_31_STABLE, MOODLE_404_STABLE

      A JPEG file of about 4MB can generate up to 300MB of memory. When it happens, an "Allowed memory size of 134217728 bytes exhausted" error occurs, and for the user, a broken icon appears. On Firefox it's a non clickable white square, which is an issue since the user can't even get the real image.

      Moodle should display a default image when the thumbnail generation fails.
      A solution would be to raise the memory at PHP level, but it can be dangerous for performances. For our Moodle we've decided to add a few "raise_memory_limit" at the right places (lib/gdlib.php, lib/filestorage/file_storage.php ).

        1. MDL-52536 01.PNG
          63 kB
          David Ligne
        2. MDL-52536 02.PNG
          21 kB
          David Ligne
        3. MDL-52536 02B.PNG
          29 kB
          David Ligne
        4. dan-duffey-FjNZVuNm0RM-unsplash.jpg
          4.43 MB
          Frederik Milling Pytlick

            Unassigned Unassigned
            ligned David Ligne
            Votes:
            4 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 22 minutes
                22m

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