Uploaded image for project: 'Magnolia UI'
  1. Magnolia UI
  2. MGNLUI-6798

JcrPreviewProvider resolves image path wrongly

XMLWordPrintable

    • Yes
    • Yes
    • UI FW 37, UI FW 38
    • 2

      Steps to reproduce

      1.  Open admincentral in demo
      2. Open the browser debugger tools to check the network activity
      3.  Open assets app and expand tours folder
      4. Check generated URLs

      Expected results

      URL to thumbnails should contain a valid format

      Actual results

      Extension is incorrectly processed and result is an URL containing two consecutive dots

      Workaround

      Set extension: jpg instead of default .jpg in the preview definition.

      Development notes

      // Crafting link manually;
      // ImagingSupport should eventually create the link but it only supports the original variation so far
      //  manual:  /.imaging/thumbnail/dam/374f8dbe-a8d7-4829-b9e7-3386a5ecb58f/blindtiger.png.jpg
      // imaging:  /.imaging/default/dam/blindtiger.png/jcr:content.png
      String imagePath = Text.escapePath(contextPath + "/" + preview.getServletPath() + "/" + generator + "/" + node.getSession().getWorkspace().getName() + "/" + imageNode.getIdentifier() + "/" + imageName + "." + preview.getExtension());
      // Add cache fingerprint so that browser caches asset only until asset is modified.
      Calendar lastModified = getLastModified(node);
      imagePath = LinkUtil.addFingerprintToLink(imagePath, lastModified);
      
      

        Acceptance criteria

              mdivilek Milan Divilek
              jayala Jonathan Ayala
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: