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

Generated image thumbnail may have a missing line on the right/bottom

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 4.2.7, 4.3.4
    • 4.3.4
    • Files API
    • 1
    • Team Hedgehog 2024 Sprint 1.3

      I guess it's a rounding error coming from here:
      https://github.com/moodle/moodle/blob/v4.3.3/lib/gdlib.php#L353-L368

      Here is an example of the generated image
      https://hq.moodle.com/pluginfile.php/7493/course/overviewfiles/Main%20page%20image.jpg
      https://hq.moodle.com/pluginfile.php/7493/course/overviewfiles/Main%20page%20image.jpg?preview=bigthumb

      We use 'floor()' there and looks like when we dvidide and multiply by the same number we can have a result 249.999999999 which is floor-ed to 249

      The generated bigthumb has a white line on the right:

      Try it yourself:

        1. bithumb.png
          50 kB
          Marina Glancy
        2. Main page image.jpg
          97 kB
          Marina Glancy
        3. example.png
          35 kB
          Marina Glancy
        4. (1) 4 Passed -- (Main)MDL-81256.png
          51 kB
          Kim Jared Lucas
        5. (1) 5 Passed -- (Main)MDL-81256.png
          75 kB
          Kim Jared Lucas

            marina Marina Glancy
            marina Marina Glancy
            Stevani Andolo Stevani Andolo
            Safat Shahin Safat Shahin
            Kim Jared Lucas Kim Jared Lucas
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 hours, 55 minutes
                3h 55m

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