Sign up (with export icon)

image/imageresize/utils/getselectedimagewidthinunits

Api-module icon module

Functions

  • Chevron-right icon

    getSelectedImageWidthInUnits( editor, targetUnit ) → null | DimensionWithUnit
    internal

    Returns image width in specified units. It is width of image after resize.

    * If image is not selected or command is disabled then `null` will be returned.
    * If image is not fully loaded (and it is impossible to determine its natural size) then `null` will be returned.
    * If `targetUnit` percentage is passed then it will return width percentage of image related to its accessors.
    
    Copy code

    Parameters

    editor : Editor

    Editor instance.

    targetUnit : string

    Unit in which dimension will be returned.

    Returns

    null | DimensionWithUnit

    Parsed image width after resize (with unit).