Uploaded image for project: 'Hippo CMS'
  1. Hippo CMS
  2. CMS-6077

Image upload: colors get mixed up with BGR color model

    XMLWordPrintable

Details

    • Bug
    • Status: Open
    • Normal
    • Resolution: Unresolved
    • 2.20.09, 2.22.03, 2.24.00
    • None
    • None
    • On Windows, on Unix-like OS

    Description

      We discovered a problem with certain JPEG images where the colors get really mixed up after uploading into the CMS. See attached 'before' (image-original) and 'after' (image-downloaded-from-CMS) files. (The original is quite big but a scaled down version does not have the problem).

      In a 7.7.1 debug session, we got to org.imgscalr.Scalr.createOptimalImage where the image type of a new BufferedImage is set to either BufferedImage.TYPE_INT_RGB or BufferedImage.TYPE_INT_ARGB. But the originating image has a type BufferedImage.TYPE_3BYTE_BGR so a wrong type is applied which messes up the coloring.

      So, it seems that the file's colors are not stored RGB but BGR, a different color model (or color space) in which the blue is written first. Upload of these type files is not well supported.

      This is confirmed on CMS 7.6.2, CMS 7.7 and CMS 7.7.1 (also cms.demo.onehippo.com) so it occurs with the Scalr library as well as with previous implementation.

      [edit after creation]
      So it seems that this JIRA has the same problem, the thumbnail generated from "image-original.jpg" has mixed up colors!

      Attachments

        1. image-downloaded-from-CMS.jpg
          722 kB
          Jeroen Hoffman
        2. image-original.jpg
          2.69 MB
          Jeroen Hoffman

        Activity

          People

            Unassigned Unassigned
            jhoffman Jeroen Hoffman
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: