NSImage to JPEG file?

2019-01-14 Thread Carl Hoefs
I have a background macOS daemon process (aka Foundation-based "command line tool") that needs to write out a JPEG file to local disk. The image resides in an NSImage object (or alternatively, an NSData of raw RGB image data). Short of resorting to something like libjpeg, what is the ObjC way t

Re: NSImage to JPEG file?

2019-01-14 Thread Vince DeMarco
Use ImageIO. create a CGImageDestinationRef and add the CGImage to it. Vince > On Jan 14, 2019, at 12:17 PM, Carl Hoefs > wrote: > > I have a background macOS daemon process (aka Foundation-based "command line > tool") that needs to write out a JPEG file to local disk. The image resides >

Re: NSImage to JPEG file?

2019-01-14 Thread Carl Hoefs
Got it working! Thanks, that's the tip I needed. -Carl > On Jan 14, 2019, at 1:26 PM, Vince DeMarco wrote: > > Use ImageIO. > > create a CGImageDestinationRef and add the CGImage to it. > > Vince > > > >> On Jan 14, 2019, at 12:17 PM, Carl Hoefs >> wrote: >> >> I have a background macO

Re: NSImage to JPEG file?

2019-01-14 Thread Alex Zavatone
I will send you something. Sent from my iPhone > On Jan 14, 2019, at 2:17 PM, Carl Hoefs > wrote: > > I have a background macOS daemon process (aka Foundation-based "command line > tool") that needs to write out a JPEG file to local disk. The image resides > in an NSImage object (or alternat