Implement image comparison command
This commit is contained in:
@ -164,14 +164,15 @@ final class FileResource: Item {
|
||||
return prefix + "." + ext
|
||||
}
|
||||
|
||||
func imageSet(width: Int, height: Int, language: ContentLanguage, quality: CGFloat = 0.7) -> ImageSet {
|
||||
func imageSet(width: Int, height: Int, language: ContentLanguage, quality: CGFloat = 0.7, extraAttributes: String? = nil) -> ImageSet {
|
||||
let description = self.localized(in: language)
|
||||
return .init(
|
||||
image: self,
|
||||
maxWidth: width,
|
||||
maxHeight: height,
|
||||
description: description,
|
||||
quality: quality)
|
||||
quality: quality,
|
||||
extraAttributes: extraAttributes)
|
||||
}
|
||||
|
||||
func imageVersion(width: Int, height: Int, type: FileType) -> ImageVersion {
|
||||
|
@ -26,6 +26,12 @@ final class PageSettings: ObservableObject {
|
||||
@Published
|
||||
var modelViewerJsFile: FileResource?
|
||||
|
||||
@Published
|
||||
var imageCompareJsFile: FileResource?
|
||||
|
||||
@Published
|
||||
var imageCompareCssFile: FileResource?
|
||||
|
||||
init(file: PageSettingsFile, files: [String : FileResource]) {
|
||||
self.contentWidth = file.contentWidth
|
||||
self.largeImageWidth = file.largeImageWidth
|
||||
@ -35,6 +41,7 @@ final class PageSettings: ObservableObject {
|
||||
self.audioPlayerJsFile = file.audioPlayerJsFile.map { files[$0] }
|
||||
self.audioPlayerCssFile = file.audioPlayerCssFile.map { files[$0] }
|
||||
self.modelViewerJsFile = file.modelViewerJsFile.map { files[$0] }
|
||||
self.imageCompareCssFile = file.imageCompareCssFile.map { files[$0] }
|
||||
}
|
||||
|
||||
var file: PageSettingsFile {
|
||||
@ -45,6 +52,8 @@ final class PageSettings: ObservableObject {
|
||||
codeHighlightingJsFile: codeHighlightingJsFile?.id,
|
||||
audioPlayerJsFile: audioPlayerJsFile?.id,
|
||||
audioPlayerCssFile: audioPlayerCssFile?.id,
|
||||
modelViewerJsFile: modelViewerJsFile?.id)
|
||||
modelViewerJsFile: modelViewerJsFile?.id,
|
||||
imageCompareJsFile: imageCompareJsFile?.id,
|
||||
imageCompareCssFile: imageCompareCssFile?.id)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user