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

Fix picture size truncation

    XMLWordPrintable

    Details

    • Release Notes Summary:
      Image scaling keeps the original ratio.
    • Release Notes Description:
      Hide

      org.nuxeo.ecm.platform.picture.ImagingComponent#getSize is deprecated in 11.1
      Use instead org.nuxeo.ecm.platform.picture.magick.utils.ImageResizer#scaleToMax

      Show
      org.nuxeo.ecm.platform.picture.ImagingComponent#getSize is deprecated in 11.1 Use instead org.nuxeo.ecm.platform.picture.magick.utils.ImageResizer#scaleToMax
    • Tags:
    • Backlog priority:
      500
    • Sprint:
      l2it-11.1.6

      Description

      When the target size of a picture conversion is computed, the values (width or height) are truncated, instead of rounded => it will cause an inconsistency between the metadata saved on the document and the real size of the generated picture.

      For example,

      1. Take a picture whose size is 1638x2000px
      2. ImagingComponent#getSize will compute a size of 81x100px for the thumbnail
      3. The search ratio would give 81,9x100 which should be rounded to 82x100
      4. The conversion will call the command
        convert -define registry:temporary-path=/tmp -quiet -background white -flatten -depth 8 originalPix.jpeg[0] jpg:- | convert - -resize 81x100 thumbnail.jpg 
      5. It produces a picture whose size is 81x99 (!= 81x100)

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 4 hours
                4h