File
public struct File
A file type.
-
Create a File.
Declaration
Swift
public init(name: String, data: Data)
Parameters
name
the name of the file.
data
the data of the file.
-
Create a File from a given image.
Declaration
Swift
init?(name: String, jpegImage: Image, compressionQuality: CGFloat = 0.9)
Parameters
name
the name of the image.
jpegImage
the image, that would be converted to a JPEG data.
compressionQuality
The quality of the resulting JPEG image, expressed as a value from 0.0 to 1.0. The value 0.0 represents the maximum compression (or lowest quality) while the value 1.0 represents the least compression (or best quality). Default: 0.9.
-
Create a File from a given image.
Declaration
Swift
init?(name: String, pngImage: Image)
Parameters
name
the name of the image.
pngImage
the image, that would be converted to a PNG data.
-
A helper function to create
File
‘s from images in working thread.Declaration