Skip to content

Commit f02dc22

Browse files
committed
Revert temporaril
LibSPNG requires the source image already be indexed with a color table, which makes sense. Since our source is always RBGA the indexed image needs to be built manually.
1 parent 3113c14 commit f02dc22

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Sources/GateEngine/Resources/Import & Export/Coding/PNGCoder.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ public final class PNGEncoder {
4545
*/
4646
public func encode(_ data: Data, width: Int, height: Int, sacrificePerformanceToShrinkData: Bool = false) throws(GateEngineError) -> Data {
4747
#if canImport(LibSPNG)
48-
if sacrificePerformanceToShrinkData {
49-
try LibSPNG.encodeSmallest(data: data, width: width, height: height)
50-
}else{
48+
// if sacrificePerformanceToShrinkData {
49+
// try LibSPNG.encodeSmallest(data: data, width: width, height: height)
50+
// }else{
5151
try LibSPNG.encodeRGBA(data: data, width: width, height: height, optimizeAlpha: false)
52-
}
52+
// }
5353
#else
5454
fatalError("PNGEncoder is not supported on this platform.")
5555
#endif

0 commit comments

Comments
 (0)