code: function withMetadata (withMetadata) {
    this.options.withMetadata = is.bool(withMetadata) ? withMetadata : true;
    if (is.object(withMetadata)) {
      if (is.defined(withMetadata.orientation)) {
        if (is.integer(withMetadata.orientation) && is.inRange(withMetadata.orientation, 1, 8)) {
          this.options.withMetadataOrientation = withMetadata.orientation;
        } else {
          throw new Error('Invalid orientation (1 to 8) ' + withMetadata.orientation);
        }
      }
    }
    return this;
  }
docs: Include all metadata (EXIF, XMP, IPTC) from the input image in the output image.
  The default behaviour, when `withMetadata` is not used, is to strip all metadata and convert to the device-independent sRGB colour space.
  This will also convert to and add a web-friendly sRGB ICC profile.
  
  @example
  sharp('input.jpg')
  .withMetadata()
  .toFile('output-with-metadata.jpg')
  .then(info => { ... });
  
  @param {Object} [withMetadata]
  @param {Number} [withMetadata.orientation] value between 1 and 8, used to update the EXIF `Orientation` tag.
  @returns {Sharp}
  @throws {Error} Invalid parameters