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

Images are resized in tables if image size is set to "Original"

    XMLWordPrintable

Details

    Description

      Problem summary

      Since updating to Confluence 5.7.1, tables no longer respect image sizes. Images appear to be the correct size in edit mode, but when saved are drastically shrunk. This is affecting pages that had been previously created/saved and looked normal before the upgrade and new pages. Screenshots are attached. Look specifically at the register buttons. In preview mode those are the actual sizes of the images, and when saved, they look like blue dashes.

      The cause for this is because the images do not have a fixed size set. When clicking on the image, the image toolbar shows the size as "Original", implying that the original size of the image will be what is displayed on the page after it is saved. However, the actual behavior is that the image in view mode will be influenced based on the other elements on the page when rendered in View mode, which is especially apparent in a table that is shared with another column that has a lot of text (see screenshots for examples).

      Steps to reproduce

      1. In Confluence 5.7.1, create a page with a two-column table
      2. In the first column, drag-and-drop an image that is smaller than 250px in height (e.g. shark.jpg, 200px in height)
      3. In the second column, insert an LoremIpsum macro
      4. Save the page

      Expected behavior

      The image is displayed at the same size as shown in the editor, as implied by "Original" image size setting

      Actual behavior

      The image shrinks in size depending on the other elements in the page

      Other notes

      • This behavior affects images that are 249px or less in height.
      • This behavior does not affect uploaded images that are 250px or greater in size, as Confluence automatically assigns a pre-set "medium" size to these images.
      • However, if images 250px or greater are manually set to use the "Original" size (i.e. overriding the Confluence default assigned size), then these images will lose their fixed display size, and will be affected.
      • This behavior is observed in Chrome and Safari, but not Firefox. Firefox will display the images true to their original size.

      Workaround 1 (simple)

      The workaround to get around this problem is to assign a fixed size manually to the small images.

      1. Click on the images once they are uploaded
      2. Select one of the pre-set sizes (small, medium, or large) as you see fit. These pre-set sizes map to the following pixel counts, in image width:
                sizes = {
                    small: 100,
                    medium: 300,
                    large: 500
                };
        
      3. Save the page, and the image should be fixed to whatever size you have configured, and will not change despite the rest of the page.

      Workaround 2 (complex)

      Alternatively, if one of these pre-set sizes don't work for you, you can also set an explicit size by inputting a px size using the leftmost field in the image toolbar. By default this field will show the full width of the image, in pixels. The tricky part about this is that unless you enter a different value that what is there, it won't store the value. You must set this value to something else, then back to the original value, as detailed below.

      1. Click on the images once they are uploaded
      2. Take note of the pixel value in the leftmost box, and then set it to something else. Press enter. The option "Original" should now be un-highlighted
      3. Set the text box back to the original pixel value, and press enter again.
      4. Save the page, and the image should be fixed to whatever size you have configured, and will not change despite the rest of the page.

      Attachments

        1. correct image sizes in edit mode.PNG
          correct image sizes in edit mode.PNG
          54 kB
        2. images shrunk in view mode.PNG
          images shrunk in view mode.PNG
          40 kB
        3. edit mode service rocket.PNG
          edit mode service rocket.PNG
          158 kB
        4. view mode service rocket.PNG
          view mode service rocket.PNG
          147 kB
        5. shark.jpg
          shark.jpg
          63 kB

        Issue Links

          Activity

            People

              datran Dat Tran (Inactive)
              c5ce07254660 Natalie S.
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: