CGImageRef grayscaleImage;
{
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceGray();
CGContextRef bitmapCtx = CGBitmapContextCreate(bwbuffer, width, height, 8, width, colorSpace, (CGBitmapInfo)kCGImageAlphaNone);
grayscaleImage = CGBitmapContextCreateImage(bitmapCtx);
CFRelease(bitmapCtx);
CFRelease(colorSpace);
}
UIImage *temp = [[UIImage alloc] initWithCGImage:grayscaleImage];
CFStringRef UTI= (CFStringRef)@"public.heic";
NSMutableData *newImageData = [NSMutableData data];
CGImageDestinationRef destination = CGImageDestinationCreateWithData((__bridge CFMutableDataRef)newImageData,UTI,1,NULL);
CGImageDestinationAddImage(destination, temp.CGImage, (__bridge CFDictionaryRef)metaDataDictNew);
CGImageDestinationFinalize(destination);
This code running on iOS15. However iOS16 can't write grayscale HEIC image file.RGB image file is OK.
The following were error message on console of xcode.
writeImageAtIndex:867: *** CMPhotoCompressionSessionAddImage: err = kCMPhotoError_InvalidData [-17102] (codec: 'hvc1')
I can't find this error code in the Apple Support site also Documentation.
Best regards.
Post
Replies
Boosts
Views
Activity
Hello All.
iOS15 can't play sound sound only Local Notification.
Before iOS15 I can use following code.title, body and subtitle is @"" (No charactor).
UNMutableNotificationContent* content = [[UNMutableNotificationContent alloc] init];
content.title = @"";
content.body = @"";
content.subtitle = @"";
content.sound = [UNNotificationSound soundNamed:@"test"];
When iOS15, I need add content.title for play sound. I don't want display Notification on banner and notification center also Lock Screen.
I want use Sound only Local Notification. Is it a specification of iOS15 or BUGS?