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. activityStream.png
          50 kB
          Marius Dumitru Florea
        2. comments.png
          62 kB
          Marius Dumitru Florea
        3. userIndex.png
          56 kB
          Marius Dumitru Florea
        4. userPicker.png
          34 kB
          Marius Dumitru Florea

        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: