aboutsummaryrefslogtreecommitdiff
path: root/Map/Core Extensions/NSImage+writePNG.swift
diff options
context:
space:
mode:
authorRuben Beltran del Rio <git@r.bdr.sh>2024-09-16 11:10:32 +0200
committerRuben Beltran del Rio <git@r.bdr.sh>2024-09-16 11:10:32 +0200
commite2c37ac1dd2ad562e3d619d39b72a174a2212b67 (patch)
treed4da2c0a12db0473eb4030014a92045eebe38834 /Map/Core Extensions/NSImage+writePNG.swift
parentfdb4633d3e9158e457d57e820df6e1efb4df39c2 (diff)
Map 3 first commit: files, groups and layout
Diffstat (limited to 'Map/Core Extensions/NSImage+writePNG.swift')
-rw-r--r--Map/Core Extensions/NSImage+writePNG.swift25
1 files changed, 0 insertions, 25 deletions
diff --git a/Map/Core Extensions/NSImage+writePNG.swift b/Map/Core Extensions/NSImage+writePNG.swift
deleted file mode 100644
index c24c0cf..0000000
--- a/Map/Core Extensions/NSImage+writePNG.swift
+++ /dev/null
@@ -1,25 +0,0 @@
-import Cocoa
-
-extension NSImage {
- public func writePNG(toURL url: URL) {
-
- guard let data = tiffRepresentation,
- let rep = NSBitmapImageRep(data: data),
- let imgData = rep.representation(
- using: .png, properties: [.compressionFactor: NSNumber(floatLiteral: 1.0)])
- else {
-
- print(
- "\(self.self) Error Function '\(#function)' Line: \(#line) No tiff rep found for image writing to \(url)"
- )
- return
- }
-
- do {
- try imgData.write(to: url)
- } catch let error {
- print(
- "\(self.self) Error Function '\(#function)' Line: \(#line) \(error.localizedDescription)")
- }
- }
-}