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

Inserting an SVG file using the "Insert image" doesn't work well with "Auto-size"

    XMLWordPrintable

Details

    • MOODLE_400_STABLE
    • MOODLE_310_STABLE, MOODLE_311_STABLE
    • MDL-72884-310
    • MDL-72884-311
    • Hide

      Must be tested in

      • Chrome (behavior with this browser is different, hence not tested here)
      • Firefox

      Add JPG

      1. Login as admin
      2. Create a course
      3. Add a label
      4. Press Insert or edit image
      5. Upload cat.jpg
      6. Confirm Size fields show 299 x 207 and Auto size is enabled/checked
      7. Set width to 120, click on height
      8. Confirm height value changes to 83
      9. Give the image a description and press Save image

      Add SVG

      1. Hit return in editor to add some new lines
      2. Press Insert or edit image
      3. Upload caution.svg
      4. Confirm Size fields show 160 x 160 and Auto size is disabled/unchecked
      5. Set width to 120, click on height
      6. Confirm height value remains at 160
      7. Give the image a description and press Save image

      Edit JPG

      1. Double click on the first image you added
      2. Confirm Size fields show 120 x 83 and Auto size is enabled/checked
      3. Press Save image

      Edit SVG

      1. Double click on the second image you added
      2. Confirm Size fields should 120 x 160 and Auto size is disabled/unchecked
      3. Press Save image
      Show
      Must be tested in Chrome (behavior with this browser is different, hence not tested here) Firefox Add JPG Login as admin Create a course Add a label Press Insert or edit image Upload cat.jpg Confirm Size fields show 299 x 207 and Auto size is enabled/checked Set width to 120, click on height Confirm height value changes to 83 Give the image a description and press Save image Add SVG Hit return in editor to add some new lines Press Insert or edit image Upload caution.svg Confirm Size fields show 160 x 160 and Auto size is disabled/unchecked Set width to 120, click on height Confirm height value remains at 160 Give the image a description and press Save image Edit JPG Double click on the first image you added Confirm Size fields show 120 x 83 and Auto size is enabled/checked Press Save image Edit SVG Double click on the second image you added Confirm Size fields should 120 x 160 and Auto size is disabled/unchecked Press Save image

    Description

      Trying to add an SVG image to text content using the Atto Insert or edit image dialogue is quite frustrating, as the Auto size element is automatically selected, but cannot detect the size of the SVG and fills in the width/height values as NaN which then won't let you save the form

      Example above using the SVG attached to MDL-72443

      Attachments

        1. 72884.gif
          72884.gif
          337 kB
        2. cat.jpg
          cat.jpg
          14 kB
        3. caution.svg
          0.4 kB
        4. MDL-72884_master_firefox.gif
          MDL-72884_master_firefox.gif
          3.41 MB
        5. MDL-72884_v310_firefox.gif
          MDL-72884_v310_firefox.gif
          3.58 MB
        6. MDL-72884_v311_firefox.gif
          MDL-72884_v311_firefox.gif
          3.17 MB
        7. photo_2021-11-02_15-18-58.jpg
          photo_2021-11-02_15-18-58.jpg
          27 kB

        Issue Links

          Activity

            People

              pholden Paul Holden
              pholden Paul Holden
              David Mudrák (@mudrd8mz) David Mudrák (@mudrd8mz)
              Andrew Lyons Andrew Lyons
              Angelia Dela Cruz Angelia Dela Cruz
              Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              1 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                8/Nov/21

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 hour, 55 minutes
                  1h 55m