How to use the @wireapp/protocol-messaging.Asset.ImageMetaData function in @wireapp/protocol-messaging

To help you get started, we’ve selected a few @wireapp/protocol-messaging examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wireapp / wire-webapp / test / unit_tests / cryptography / CryptographyMapperSpec.js View on Github external
it('resolves with a mapped medium image message when receiving v3', () => {
      const image_meta_data = new Asset.ImageMetaData({
        height: 640,
        width: 1280,
      });
      const original = new Asset.Original({
        image: image_meta_data,
        mimeType: 'image/jpg',
        size: 1024,
      });

      const remote_data = new Asset.RemoteData({
        assetId: createRandomUuid(),
        assetToken: createRandomUuid(),
        otrKey: new Uint8Array([1, 2]),
        sha256: new Uint8Array([3, 4]),
      });
github wireapp / wire-webapp / src / script / assets / AssetService.ts View on Github external
return this._uploadAsset(compressedBytes, options, xhrAccessorFunction).then(protoAsset => {
        const assetImageMetadata = new Asset.ImageMetaData({
          height: compressedImage.height,
          width: compressedImage.width,
        });

        const assetOriginal = new Asset.Original({
          image: assetImageMetadata,
          mimeType: image.type,
          size: compressedBytes.length,
        });

        protoAsset[PROTO_MESSAGE_TYPE.ASSET_ORIGINAL] = assetOriginal;
        return protoAsset;
      });
    });
github wireapp / wire-webapp / src / script / assets / AssetService.js View on Github external
return this._uploadAsset(compressedBytes, options, xhrAccessorFunction).then(protoAsset => {
        const assetImageMetadata = new Asset.ImageMetaData({
          height: compressedImage.height,
          width: compressedImage.width,
        });

        const assetOriginal = new Asset.Original({
          image: assetImageMetadata,
          mimeType: image.type,
          size: compressedBytes.length,
        });

        protoAsset[z.cryptography.PROTO_MESSAGE_TYPE.ASSET_ORIGINAL] = assetOriginal;
        return protoAsset;
      });
    });
github wireapp / wire-webapp / src / script / assets / AssetMetaDataBuilder.ts View on Github external
image.onload = () => {
      resolve(new Asset.ImageMetaData({height: image.height, width: image.width}));
      window.URL.revokeObjectURL(url);
    };
    image.onerror = error => {