Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-28274

Don't assume picture dimensions prior to conversion

    XMLWordPrintable

    Details

    • Release Notes Summary:
      Picture dimensions are set after the conversions.
    • Backlog priority:
      500
    • Sprint:
      nxplatform 11.1.25, nxplatform 11.1.26
    • Story Points:
      3

      Description

      This section of the ImagingComponent class calculates height and width based on the maxSize parameter prior to conversion

              if (pictureConversion.getMaxSize() != null) {
                  size = ImageResizer.scaleToMax(size.x, size.y, pictureConversion.getMaxSize());
              }        pictureViewMap.put(PictureView.FIELD_WIDTH, size.x);
              pictureViewMap.put(PictureView.FIELD_HEIGHT, size.y); 

      while the section after the conversion (callPictureConversionChain) determines the real height and width from the ImageInfo of the result image

              pictureViewMap.put(PictureView.FIELD_INFO, getImageInfo(viewBlob));
      

      If the picture conversion returns something not matching the expected maxSize it leads to the picture height and width conflicting with the image info height and width. As it becomes common to contribute custom picture conversions (https://doc.nuxeo.com/nxdoc/how-to-contribute-a-command-line-converter/, https://doc.nuxeo.com/nxdoc/how-to-contribute-picture-conversions/) this code should avoid recording conflicting image metadata.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                1 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Time Spent - 3 days Remaining Estimate - 2 days
                  2d
                  Logged:
                  Time Spent - 3 days Remaining Estimate - 2 days
                  3d