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

Problem with the ImageUtils class

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • High
    • Resolution: Fixed
    • r2.06.13, r2.09.00
    • r2.06.14, r2.09.02
    • None
    • None

    Description

      We are using the class ImageUtils for our import project. One remark, there are two different ImageUtils classes in the code base.

      The class itself has a memory problem. The Readers are cached in a static map. Problem with these readers is that they keep a reference to the actual byte[]. I also do not see a very good reason to cache these readers. The memory problem becomes visible with bigger files, but each type keeps a lot of memory. To give you an idea, we had a picture of 8Mb that took over 300 Mb of memory.

      I am also wondering why the thumbnail method returns the byte[] of the original image if something goes wrong, why not throw an exception. The same thing for obtaining specific readers. Why return null and not an exception?

      I made a fix, that made the class more readable. Beware I removed all the static stuff. Maybe you can use it for a change. Most urgent is the memory problem stuff.

      Attachments

        Activity

          People

            abogaart Arthur Bogaart
            jcoenradie Jettro Coenradie (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: