Create 2x images explicitly
This commit is contained in:
parent
ab2bc663ec
commit
f2b4851599
@ -187,7 +187,7 @@ final class FileSystem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@discardableResult
|
@discardableResult
|
||||||
func requireImage(source: String, destination: String, width: Int, desiredHeight: Int? = nil, createDoubleVersion: Bool = false) -> NSSize {
|
func requireImage(source: String, destination: String, width: Int, desiredHeight: Int? = nil) -> NSSize {
|
||||||
let height = desiredHeight.unwrapped(CGFloat.init)
|
let height = desiredHeight.unwrapped(CGFloat.init)
|
||||||
let sourceUrl = input.appendingPathComponent(source)
|
let sourceUrl = input.appendingPathComponent(source)
|
||||||
let image = ImageOutput(source: source, width: width, desiredHeight: desiredHeight)
|
let image = ImageOutput(source: source, width: width, desiredHeight: desiredHeight)
|
||||||
|
@ -41,8 +41,15 @@ struct ThumbnailListGenerator {
|
|||||||
source: fullThumbnailPath,
|
source: fullThumbnailPath,
|
||||||
destination: fullThumbnailPath,
|
destination: fullThumbnailPath,
|
||||||
width: style.width,
|
width: style.width,
|
||||||
desiredHeight: style.height,
|
desiredHeight: style.height)
|
||||||
createDoubleVersion: true)
|
|
||||||
|
// Create image version for high-resolution screens
|
||||||
|
files.requireImage(
|
||||||
|
source: fullThumbnailPath,
|
||||||
|
destination: fullThumbnailPath.insert("@2x", beforeLast: "."),
|
||||||
|
width: style.width * 2,
|
||||||
|
desiredHeight: style.height * 2)
|
||||||
|
|
||||||
return factory.thumbnail(style: style).generate(content, shouldIndent: false)
|
return factory.thumbnail(style: style).generate(content, shouldIndent: false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user