scale(scaleX, scaleY = scaleX) {
    const { element, options, imageData } = this;

    scaleX = Number(scaleX);
    scaleY = Number(scaleY);

    if (this.viewed && !this.played && options.scalable) {
      const oldScaleX = imageData.scaleX;
      const oldScaleY = imageData.scaleY;
      let changed = false;

      if (isNumber(scaleX)) {
        changed = true;
      } else {
        scaleX = oldScaleX;
      }

      if (isNumber(scaleY)) {
        changed = true;
      } else {
        scaleY = oldScaleY;
      }

      if (changed) {
        if (isFunction(options.scale)) {
          addListener(element, EVENT_SCALE, options.scale, {
            once: true,
          });
        }

        if (dispatchEvent(element, EVENT_SCALE, {
          scaleX,
          scaleY,
          oldScaleX,
          oldScaleY,
        }) === false) {
          return this;
        }

        imageData.scaleX = scaleX;
        imageData.scaleY = scaleY;
        this.scaling = true;
        this.renderImage(() => {
          this.scaling = false;

          if (isFunction(options.scaled)) {
            addListener(element, EVENT_SCALED, options.scaled, {
              once: true,
            });
          }

          dispatchEvent(element, EVENT_SCALED, {
            scaleX,
            scaleY,
            oldScaleX,
            oldScaleY,
          }, {
            cancelable: false,
          });
        });
      }
    }

    return this;
  }
Scale the image.
@param {number} scaleX - The scale ratio on the x-axis.
@param {number} [scaleY=scaleX] - The scale ratio on the y-axis.
@returns {Viewer} this