Preparing search index...

    Function reachesBound

    • Tells whether an image decoded under the MAX_IMAGE_DIMENSION bound was downscaled by the decoder.

      A bounded decode never upscales: a source smaller than the bound comes back at its own size, while a larger one comes back with its longest side equal to the bound. A source whose longest side already equals the bound is therefore reported as reaching it.

      Parameters

      • size: ImageSize

        Pixel dimensions returned by the bounded decode

      Returns boolean

      true when the longest side reached the bound, false when the source was smaller or the dimensions are unusable

      reachesBound({ width: 1280, height: 960 }) // true — a 4032x3024 source was downscaled
      reachesBound({ width: 800, height: 600 }) // false — the source already fit