Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-7623

Bad Image Scaling Quality

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Major
    • 8.4.4, 9.0-rc-1
    • 2.5 M2
    • Old Core
    • None
    • High
    • Medium
    • N/A

    Description

      Scaling an image (especially downscaling to less than half the size of the original image) produces quite bad results with very visible edges.

      This is a known problem of the normal Java2D scaled image drawing operations, described in this article: http://today.java.net/pub/a/today/2007/04/03/perils-of-image-getscaledinstance.html

      The article also provides a simple workaround that would greatly improve the image quality of down-scaled images with just a small increase in processing time. (if you use the example code from the article, plaase note that there's a bug with regard to upscaling images leading to an infinite loop, but that should be easy to fix).

      In my particular use case I'd like to produce a team list using the avatars stored with each account. And due to this bug the avatars of those who upload high-resolution pictures look worst in that list.

      Attachments

        1. userPicker.png
          userPicker.png
          34 kB
        2. userIndex.png
          userIndex.png
          56 kB
        3. comments.png
          comments.png
          62 kB
        4. activityStream.png
          activityStream.png
          50 kB

        Issue Links

          Activity

            People

              mflorea Marius Dumitru Florea
              jsauer Joachim Sauer
              Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: