Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-26016

pdf export fails to retrieve image if the image on the page is a web image and url contains "download/attachments"

    XMLWordPrintable

Details

    Description

      NOTE: This bug report is for Confluence Server. Using Confluence Cloud? See the corresponding bug report.

      If you insert a web image to a page whose url contains the text download/attachments (such as this image http://confluence.atlassian.com/download/attachments/139467/confluence-3-0-profile-view.png?version=2&modificationDate=1243658607572), and then export that page as pdf, the image will not resolve, and you will get a warning in the logs

      [confluence.extra.flyingpdf.ConfluenceExportUserAgent] getImageResource Could not retrieve image resource http://confluence.atlassian.com/download/attachments/139467/confluence-3-0-profile-view.png?version=2&modificationDate=1243658607572 during Confluence export : The byte array is not a recognized imageformat.
      

      The pdf exports continue, but where the image should've been, is instead an empty space.

      Environment

      Confluence 6.13.0
      Confluence 6.15.3

      Steps to Reproduce

      1. Upload an image file to a page
      2. Navigate to the Attachments view of the page such as the URL below:
      3. Open the image uploaded from Step 1 in a new tab and the URL should look something like below:
      4. Create a new page and insert a new image via the "Insert files and images"(CTRL+M) > Images from the web
      5. Enter the image URL from above step and Publish the page
      6. Verify the image can be seen in the View Page Mode
      7. Export the page to PDF

      Expected Results

      The page is exported to PDF successfully with the image in the exported PDF file.

      Actual Results

      The page is exported successfully to a PDF File but the image with the "download/attachments" URL is not included in the PDF

      In the atlassian-confluence.log, this warning message is being logged:

      2019-06-12 09:37:39,211 WARN [http-nio-26130-exec-2] [confluence.extra.flyingpdf.ConfluenceExportUserAgent] getImageResource Could not retrieve image resource http://localhost:26130/c6130/download/attachments/65608/bananas.jpg?api=v2 during Confluence export
       -- url: /c6130/spaces/flyingpdf/pdfpageexport.action | page: 65608 | traceId: 8c42641476275a1b | userName: admin | referer: http://localhost:26130/c6130/display/PROJ/Banana+here | action: pdfpageexport
      

      The more "download/attachments" image links in the page, PDF Export of the page will take significantly longer time to complete.

      Workarounds:

      • If the image is from Confluence, insert the image directly from the page using Confluence's file tools, rather than linking to the image URL. This will also have the added benefit of keeping the image updated if a new version of the image is ever uploaded:
        1. Click the "Insert Files and Images" button on the toolbar.
        2. Select "Search on other pages" in the dialogue sidebar.
        3. Enter the page you'd like to insert the image from in the search bar, then click Search.
        4. Select the images you'd like to insert.
        5. Click Insert.
        6. The page should now export successfully with the images.
      • If the image is from an external site, add the problematic image as an attachment first, and then replace the web image with the attachment on the page before exporting.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jxie Chii
              Votes:
              48 Vote for this issue
              Watchers:
              55 Start watching this issue

              Dates

                Created:
                Updated: