Prevent saving when some file properties change
This commit is contained in:
@ -48,12 +48,22 @@ final class FileResource: Item, LocalizedItem {
|
||||
var isAsset: Bool
|
||||
|
||||
/// The dimensions of the image
|
||||
@Published
|
||||
var imageDimensions: CGSize? = nil
|
||||
var imageDimensions: CGSize? {
|
||||
get { content.dimensions(of: id) }
|
||||
set {
|
||||
content.cache(dimensions: newValue, of: id)
|
||||
didChange(save: false)
|
||||
}
|
||||
}
|
||||
|
||||
/// The size of the file in bytes
|
||||
@Published
|
||||
var fileSize: Int? = nil
|
||||
var fileSize: Int? {
|
||||
get { content.size(of: id) }
|
||||
set {
|
||||
content.cache(size: newValue, of: id)
|
||||
didChange(save: false)
|
||||
}
|
||||
}
|
||||
|
||||
var savedData: Data?
|
||||
|
||||
|
Reference in New Issue
Block a user