Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-72995

PNGs are not scaled and thumbnails are not generated

    Details

      Description

      Reproduction steps for Master, 7.1.x:

      1. Upload attached png 'pnggrad16rgb.png' to DL

      Additional information:
      This error comes from the JVM and it is dependent from the OS version and the JVM version. This has been reproduced under Ubuntu 16.04 + openjdk version "1.8.0_212".

      Expected behavior:
      Image is uploaded without errors.

      Actual behavior:
      The following error is seen in log:

      2019-05-28 09:52:30.574 WARN  [liferay/adaptive_media_processor-1][AMMessageListener:81] java.lang.IllegalArgumentException: Unknown image type 0
      java.lang.IllegalArgumentException: Unknown image type 0
      	at java.awt.image.BufferedImage.<init>(BufferedImage.java:501)
      	at com.liferay.portal.image.ImageToolImpl.doScale(ImageToolImpl.java:796)
      	at com.liferay.portal.image.ImageToolImpl.scale(ImageToolImpl.java:759)
      	at com.liferay.portal.kernel.image.ImageToolUtil.scale(ImageToolUtil.java:269)
      	at com.liferay.adaptive.media.image.internal.scaler.AMDefaultImageScaler.scaleImage(AMDefaultImageScaler.java:61)
      	at com.liferay.adaptive.media.image.internal.processor.AMImageProcessorImpl.process(AMImageProcessorImpl.java:123)
      	at com.liferay.adaptive.media.image.internal.processor.AMImageProcessorImpl.lambda$process$0(AMImageProcessorImpl.java:76)
      	at java.util.ArrayList.forEach(ArrayList.java:1257)
      	at com.liferay.adaptive.media.image.internal.processor.AMImageProcessorImpl.process(AMImageProcessorImpl.java:75)
      	at com.liferay.adaptive.media.image.internal.processor.AMImageProcessorImpl.process(AMImageProcessorImpl.java:43)
      	at com.liferay.adaptive.media.web.internal.messaging.AMProcessorCommand$2.execute(AMProcessorCommand.java:43)
      	at com.liferay.adaptive.media.web.internal.messaging.AMMessageListener.doReceive(AMMessageListener.java:77)
      	at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:26)
      	at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:74)
      	at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:52)
      	at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExecutor.java:752)
      	at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:664)
      	at java.lang.Thread.run(Thread.java:748)
      

      Reproduction steps for 6.2.x:
      1. Set image.auto.scale=true in portal-ext.properties
      2. Start server
      3. In Site Admin > Content > Documents and Media add two basic documents: A JPG and a PNG image

      Result A: While a thumbnail is created for the JPG image, no thumbnail is created for the PNG image.

      4. Open the PNG image
      5. Click URL and copy the provided URL
      6. Paste it into browser and add width (URL + &width=200 for example)

      Result B: The image is not scaled.

        Attachments

        1. 72995_2.png
          72995_2.png
          121 kB
        2. 72995.png
          72995.png
          87 kB
        3. pnggrad16rgb.png
          pnggrad16rgb.png
          4 kB
        4. verified_master.png
          verified_master.png
          28 kB

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  1 year, 9 weeks ago

                  Packages

                  Version Package
                  6.2.X EE
                  7.1.10 DXP FP12
                  7.1.X
                  7.2.X
                  7.2.1 CE GA2
                  7.3.1 CE GA2
                  Master