Skip to content

Commit 912b862

Browse files
committed
Fixed ACB loading for earlier versions
1 parent 30942e7 commit 912b862

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Sources/ColorPaletteCodable/coders/palette/ACBPaletteCoder.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ import BytesParser
2323
public extension PAL.Coder {
2424
/// An object representing an ACB (Adobe Color Book)
2525
///
26-
/// Based on the discussion [here](https://magnetiq.ca/pages/acb-spec/)
26+
/// Based on the discussion [here](https://ates.dev/pages/acb-spec/)
27+
/// [archive](https://web.archive.org/web/20250727001358/https://ates.dev/pages/acb-spec/)
2728
///
2829
/// [Coffeescript implementation](https://github.com/jacobbubu/acb/blob/master/decoder.coffee)
2930
struct ACB: PAL_PaletteCoder {
@@ -156,7 +157,9 @@ public extension PAL.Coder.ACB {
156157
result.colors.append(color)
157158
}
158159

159-
let _ /* spotIdentifier */ = try parser.readStringASCII(length: 8)
160+
// Appears to have been added for later versions. It may or may not be there.
161+
// Given we're ignoring it, just ignore it!
162+
let _ /* spotIdentifier */ = try? parser.readStringASCII(length: 8)
160163

161164
return result
162165
}

0 commit comments

Comments
 (0)