Expand my Community achievements bar.

Get ready! An upgraded Experience League Community experience is coming in January.

Folder Thumbnail Update Job Failing with width or height <= 0 Error After DAM Update Asset Workflow

Avatar

Level 1
I am facing an issue in AEM 6.5 where the Folder Thumbnail Update Job fails every time the DAM Update Asset workflow runs. The error in the logs is:
com.day.cq.dam.core.impl.ui.preview.FolderPreviewUpdaterImpl error while executing folder thumbnail update job: /content/dam/assets/comcast/site/test-prod.jpeg
java.lang.IllegalArgumentException: width or height <= 0
    at com.day.image.Layer.init(Layer.java:3181) [day-commons-gfx:2.1.52]
    at com.day.image.Layer.<init>(Layer.java:501) [day-commons-gfx:2.1.52]
    at com.day.cq.dam.core.impl.ui.preview.FolderPreviewGenerator$FolderPreviewCreator.createPreview(FolderPreviewGenerator.java:292)
    at com.day.cq.dam.core.impl.ui.preview.AssetDrivenFolderPreviewGenerator.generate(AssetDrivenFolderPreviewGenerator.java:231)
    at com.day.cq.dam.core.impl.ui.preview.FolderPreviewUpdaterImpl.updateFolderThumbnail(FolderPreviewUpdaterImpl.java:151)​

 

This happens for all images, not just one asset.

What I Have Tried So Far:

  1. Checked OSGi Config for FolderPreviewUpdaterImpl

    • Enabled Create Folder Preview and Update Folder Preview.
    • Tried Folder Preview Rendition Regex as:
      • Blank (to allow fallback)
      • Web.* (to match my web rendition)
      • original (to force original image)
    • Still getting the same error.
  2. Verified Renditions

    • Each asset has:
      • original (e.g., 3360x1890)
      • Web 1280x1280
      • Thumbnail 319x319
      • Thumbnail 48x48
    • So renditions exist and look valid.
  3. Added FolderPreviewGenerator Config

    • Created OSGi config for:
com.day.cq.dam.core.impl.ui.preview.FolderPreviewGenerator
preview.width = 320
preview.height = 240​
  • Saved and restarted bundles.
  • Reprocessed Assets

    • Ran DAM Update Asset workflow manually.
    • Verified metadata (tiff:ImageWidth, tiff:ImageLength) exists.
    • Still same error.
  • Restarted Bundles

    • Restarted com.day.cq.dam.cq-dam-core and day-commons-gfx.
    • No change.
4 Replies

Avatar

Community Advisor

Can you check if this happens on vanilla instance as well? 

can you refer this as it has similar ask as yours https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/dam-image-renditions-error...

 

Try with Folder Preview Rendition Regex as cq5dam.web.*

Avatar

Level 1

I have tried using the Regex cq5dam.web.* but it still throws the same error, I also tried uploading different images but still got the same error.

Avatar

Community Advisor

Have you checked this on your new instance. it seems you custom configs might be causing the issue. my local instance is on AEM 6.5.21 and it doesn't have the issue.

Can you also try creating a new folder in your aem dam and try to upload the new valid assets and see how it responds? it might be possible the existing image might be corrupted

Avatar

Level 4

Hi @BhavinBhanu This is a common AEM 6.5 issue where the Folder Thumbnail Update Job fails due to the 

Layer.init()

 method receiving invalid dimensions (width or height <= 0). The problem typically occurs when AEM tries to create folder thumbnails but encounters issues with image dimension detection or rendition processing.

project and experiencing the common "width or height <= 0" error with folder thumbnail generation. This error occurs when AEM's FolderPreviewGenerator tries to create thumbnails but encounters invalid image dimensions.

Here are the most effective solutions to resolve this issue:

Solution 1: Create OSGi Configuration for FolderPreviewUpdaterImpl

Create a configuration to disable folder preview updates entirely or configure it properly:

File: 

ui.config/src/main/content/jcr_root/apps/wknd/osgiconfig/config.author/com.day.cq.dam.core.impl.ui.preview.FolderPreviewUpdaterImpl.cfg.json

 

{
  "createFolderPreview": false,
  "updateFolderPreview": false
}
 

Solution 2: Configure FolderPreviewGenerator with Safe Defaults

File: 

ui.config/src/main/content/jcr_root/apps/wknd/osgiconfig/config.author/com.day.cq.dam.core.impl.ui.preview.FolderPreviewGenerator.cfg.json

 

{
  "preview.width": 320,
  "preview.height": 240,
  "rendition.regex": "cq5dam.thumbnail.319.319.png"
}
 

Solution 3: Alternative - Use Web Rendition

File: 

ui.config/src/main/content/jcr_root/apps/wknd/osgiconfig/config.author/com.day.cq.dam.core.impl.ui.preview.FolderPreviewGenerator.cfg.json

 

{
  "preview.width": 320,
  "preview.height": 240,
  "rendition.regex": "cq5dam.web.1280.1280.*"
}
 

Solution 4: Custom Workflow Configuration

If you need folder previews, create a custom workflow step configuration:

File: 

ui.config/src/main/content/jcr_root/apps/wknd/osgiconfig/config.author/com.day.cq.dam.core.impl.ui.preview.AssetDrivenFolderPreviewGenerator.cfg.json

 

{
  "enabled": true,
  "preview.width": 320,
  "preview.height": 240,
  "fallback.enabled": true
}
 

Root Cause Analysis

The error occurs because:

  1. Invalid Dimensions: The Layer.init() method receives width or height values ≤ 0

  2. Rendition Selection: AEM can't find a suitable rendition or the selected rendition has invalid dimensions

  3. Metadata Issues: Image metadata might be corrupted or missing

Recommended Approach

  1. Immediate Fix: Use Solution 1 to disable folder preview generation entirely

  2. Long-term Fix: Use Solution 2 with specific rendition targeting

Additional Considerations

  • The error affects all images because it's a system-wide configuration issue

  • Restarting bundles alone won't fix the core configuration problem

  • The issue is common in AEM 6.5 environments with high-resolution images

Choose Solution 1 for immediate resolution, or Solution 2 if you need folder thumbnails to work properly.