Skip to content

Commit

Permalink
Complete initial implementation of library (lispkit pdf).
Browse files Browse the repository at this point in the history
  • Loading branch information
objecthub committed Jan 1, 2025
1 parent f1e7d9c commit 653aa63
Show file tree
Hide file tree
Showing 3 changed files with 241 additions and 47 deletions.
9 changes: 9 additions & 0 deletions Sources/LispKit/Compiler/EvalError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,9 @@ public enum EvalError: Int, Hashable, Codable {
case invalidPDFLineStyle
case invalidPDFIconType
case invalidPDFMarkupType
case invalidPDFPadding
case invalidPDFCalloutPoints
case cannotMapAttributeValue

public var message: String {
switch self {
Expand Down Expand Up @@ -559,6 +562,12 @@ public enum EvalError: Int, Hashable, Codable {
return "invalid PDF text annotation icon type: $0"
case .invalidPDFMarkupType:
return "invalid PDF text markup type: $0"
case .invalidPDFPadding:
return "invalid specification of PDF annotation padding: $0"
case .invalidPDFCalloutPoints:
return "a PDF callout is specified with a list of 2 or 3 points; instead $0 was provided"
case .cannotMapAttributeValue:
return "unable to interpret attribute value: $0"
}
}

Expand Down
4 changes: 2 additions & 2 deletions Sources/LispKit/Primitives/DrawingLibrary_iOS.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2049,8 +2049,8 @@ extension UIImage {
data.withUnsafeBytes {
let bytes = $0.baseAddress?.assumingMemoryBound(to: UInt8.self)
if let cfData = CFDataCreate(kCFAllocatorDefault, bytes, data.count),
let source = CGImageSourceCreateWithData(cfData, nil) {
exifData = CGImageSourceCopyPropertiesAtIndex(source, 0, nil)
let source = CGImageSourceCreateWithData(cfData, nil) {
exifData = CGImageSourceCopyPropertiesAtIndex(source, 0, nil)
}
}
}
Expand Down
Loading

0 comments on commit 653aa63

Please sign in to comment.