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

PNG Image conversion does not support transparency.

    XMLWordPrintable

Details

    • MOODLE_24_STABLE, MOODLE_28_STABLE, MOODLE_29_STABLE, MOODLE_30_STABLE
    • MOODLE_29_STABLE, MOODLE_30_STABLE
    • MDL-37308-master
    • Hide

      Manual testing

      1. Create a database activity
      2. Add a picture field type. Specify the width and height for the list view.
      3. Save the template.
      4. Add some entries. Use the two png files attached to this issue. Also add a gif file with a transparency and a jpeg file (no transparency).
      5. Go to the list view.
        • Check that the background of each of the images is not black where it should be transparent.
      6. Click on the Fields tab and edit the picture field.
      7. Remove the values for the width and height settings for the list view.
      8. Go back to the list view.
        • Check that the background of each of the images is not black where it should be transparent.

      Unit test

      1. Run the unit test - lib/filestorage/tests/file_storage_test.php and ensure that there are no errors.
      Show
      Manual testing Create a database activity Add a picture field type. Specify the width and height for the list view. Save the template. Add some entries. Use the two png files attached to this issue. Also add a gif file with a transparency and a jpeg file (no transparency). Go to the list view. Check that the background of each of the images is not black where it should be transparent. Click on the Fields tab and edit the picture field. Remove the values for the width and height settings for the list view. Go back to the list view. Check that the background of each of the images is not black where it should be transparent. Unit test Run the unit test - lib/filestorage/tests/file_storage_test.php and ensure that there are no errors.
    • Team '; drop tables Sprint 7, 3.1 Stable Sprint 1
    • Small

    Description

      The function convert_image() in /lib/filestorage/file_storage.php does not support PNG Image transparency and yet the function generate_image_thumbnail() in /lib/gdlib.php does. Could the two be 'refactored' to be consistent such that the former would use the latter if the GD2 library was installed?

      To put in context, this relates to some Grid course format work - https://moodle.org/mod/forum/discuss.php?d=218272#p952418

      I can work around this I think through employment of generate_image_thumbnail() and then save with the functions in /lib/filestorage/file_storage.php.

      Attachments

        1. greg.png
          greg.png
          34 kB
        2. greg-02.png
          greg-02.png
          0.3 kB

        Issue Links

          Activity

            People

              jpataleta Jun Pataleta
              gb2048 Gareth J Barnard
              Adrian Greeve Adrian Greeve
              Dan Poltawski Dan Poltawski
              Ryan Wyllie Ryan Wyllie
              Matteo Scaramuccia, David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              3 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                21/Dec/15