Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8048583

CustomMediaSizeName class matching to standard media is too loose

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 9
    • Component/s: client-libs
    • Labels:
    • Subcomponent:
      2d
    • Resolved In Build:
      b26

      Backports

        Description

        When a printer reports paper sizes CustomMediSizeName tries to match the reported size
        to one of the standard paper sizes such as "A4" that are defined
        in the javax.print.attribute.standard/MediaSize class and associated classes.
        This is then available as CustomMediSizeName.getStandardMedia()

        MediaSize,findMedia(..) is used to locate the matching standard media.
        We use whatever it returns which is wrong. It will try to find
        the closest paper, returning null only when the size we have
        is radically different. So often we end up matching a media with
        an inappropriate size. Instead we should consider it completely
        custom.

        If the sizes are not really close we should not report that it
        matches a standard media.

        This only affects CUPS printing as that is the only code path
        that uses CustomMediSizeName.getStandardMedia()

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                prr Philip Race
                Reporter:
                prr Philip Race
                Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: