How do I mirror a jpeg file, swift, macOS?
Using something like CGImageSourceCreateWithURL would be good. I would like to change a property and then write the file out again. Not sure if this is possible.
Another way appears to be drawing the image and then write this out to a file. The image needs to be scaled with a -1 scale and transformed so that it still appears in the destination correctly. I've not been able to find a swift example of doing this. This is an example that is not in swift. I cannot reproduce it in swift. Also using an NSImage requires decoding and then encoding the JPEG file. A solution that does not do this would be better. Flip NSImage on both axes
Edit: A vImage may be a middle ground. This will need to be populated by reading the JPEG but the data could be flipped without "drawing" it at a scale of -1. I think an NSImage could be made using initWithContentsOfURL or initByReferencingURL and a CGImage made from the NSImage using CGImageForProposedRect. The vImage made from the CGImage?