80d3c08a93
- Move to global objects for files and validation - Only write changed files - Check images for changes before scaling - Simplify code
36 lines
545 B
Swift
36 lines
545 B
Swift
import Foundation
|
|
|
|
enum ThumbnailStyle: String, CaseIterable {
|
|
|
|
case large
|
|
|
|
case square
|
|
|
|
case small
|
|
|
|
var height: Int {
|
|
switch self {
|
|
case .large:
|
|
return 210
|
|
case .square:
|
|
return 178
|
|
case .small:
|
|
return 78
|
|
}
|
|
}
|
|
var width: Int {
|
|
switch self {
|
|
case .large:
|
|
return 374
|
|
case .square:
|
|
return height
|
|
case .small:
|
|
return height
|
|
}
|
|
}
|
|
}
|
|
|
|
extension ThumbnailStyle: Codable {
|
|
|
|
}
|