MatrixImageFile class

Inheritance

Constructors

MatrixImageFile({required Uint8List bytes, required String name, String? mimeType, int? width, int? height, String? blurhash})

Properties

blurhash String?
generates the blur hash for the image
final
bytes Uint8List
finalinherited
hashCode int
The hash code for this object.
no setterinherited
height int?
returns the height of the image
no setter
info Map<String, dynamic>
no setteroverride
mimeType String
finalinherited
msgType String
no setteroverride
name String
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
size int
no setterinherited
width int?
returns the width of the image
no setter

Methods

encrypt() Future<EncryptedFile>
Encrypts this file and returns the encryption information as an EncryptedFile.
inherited
generateThumbnail({int dimension = Client.defaultThumbnailSize, Future<MatrixImageFileResizedResponse?> customImageResizer(MatrixImageFileResizeArguments)?, ComputeRunner? compute, NativeImplementations nativeImplementations = NativeImplementations.dummy}) Future<MatrixImageFile?>
Computes a thumbnail for the image. Also sets height and width on the original image if they were unset.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setImageSizeIfNull({required int? width, required int? height}) → void
If the image size is null, allow us to update it's value.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

calcMetadataImplementation(Uint8List bytes) MatrixImageFileResizedResponse?
you would likely want to use NativeImplementations and Client.nativeImplementations instead
create({required Uint8List bytes, required String name, String? mimeType, ComputeRunner? compute, NativeImplementations nativeImplementations = NativeImplementations.dummy}) Future<MatrixImageFile>
Creates a new image file and calculates the width, height and blurhash.
resizeImplementation(MatrixImageFileResizeArguments arguments) MatrixImageFileResizedResponse?
you would likely want to use NativeImplementations and Client.nativeImplementations instead
shrink({required Uint8List bytes, required String name, int maxDimension = 1600, String? mimeType, Future<MatrixImageFileResizedResponse?> customImageResizer(MatrixImageFileResizeArguments)?, ComputeRunner? compute, NativeImplementations nativeImplementations = NativeImplementations.dummy}) Future<MatrixImageFile>
Builds a MatrixImageFile and shrinks it in order to reduce traffic. If shrinking does not work (e.g. for unsupported MIME types), the initial image is preserved without shrinking it.