Skip to content

Commit 6b02f88

Browse files
author
Harlan Haskins
authored
Merge pull request #39 from griotspeak/master
update ciimage and nsimage logging
2 parents 8caffe9 + 04d8921 commit 6b02f88

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

PlaygroundLogger/PlaygroundLogger/CustomLoggable/CoreImage/CIImage+CustomOpaqueLoggable.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ extension CIImage: CustomOpaqueLoggable {
2828
#if os(macOS)
2929
let imageRep = NSCIImageRep(ciImage: self)
3030
let image = NSImage(size: imageRep.size)
31+
image.addRepresentation(imageRep)
3132
#elseif os(iOS) || os(tvOS)
3233
let image = UIImage(ciImage: self)
3334
#endif

PlaygroundLogger/PlaygroundLogger/OpaqueRepresentations/AppKit/NSImage+OpaqueImageRepresentable.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
func encodeImage(into encoder: LogEncoder, withFormat format: LogEncoder.Format) throws {
3636
guard let bitmapRep = self.bestBitmapRepresentation else {
37-
if size == .zero {
37+
if (size == .zero) || self.representations.isEmpty {
3838
// If we couldn't get a bitmap representation because the image was empty, encode empty PNG data.
3939
encoder.encode(number: 0)
4040
return

0 commit comments

Comments
 (0)