Post not yet marked as solved
UIImageWriteToSavedPhotosAlbum work well in iOS 9/10but crashed in iOS 11what 's problem?NSData* imgdata = [NSData dataWithContentsOfFile:path]; if (nil != imgdata) { UIImage* saveImg = [[UIImage alloc] initWithData:imgdata]; if (nil != saveImg) { UIImageWriteToSavedPhotosAlbum(saveImg, nil, nil, nil); return 1; } }
I have a 3d camera app that I'm working on and I am wondering how to put the two videos side-by-side to save to Photos as one video using this delegate method: func fileOutput(_ output: AVCaptureFileOutput,
didFinishRecordingTo outputFileURL: URL,
from connections: [AVCaptureConnection],
error: Error?) {
Thank You!
Post not yet marked as solved
UIImagePickerController almost always crashes in iOS13 real device.
But sometimes, I can confirm image list and I can select image.
This program almost always crashes when showing image list
This program always crashes when selecting "all photos" and particular albums in image list.But it doesn't crash selecting other albums .
And since iOS13, on my iPhone, some existing image editing applications crash when selecting images.
class ViewController: UIViewController, UIImagePickerControllerDelegate,
UINavigationControllerDelegate{
var myImagePicker: UIImagePickerController!
override func viewDidLoad() {
super.viewDidLoad()
myImagePicker = UIImagePickerController()
myImagePicker.sourceType = UIImagePickerController.SourceType.photoLibrary
myImagePicker.delegate = self
}
private func showPicker() {
if UIImagePickerController.isSourceTypeAvailable(
UIImagePickerController.SourceType.photoLibrary){
			self.present(myImagePicker, animated: true, completion: nil)
}
}
func imagePickerControllerDidCancel(_ picker: UIImagePickerController) {
self.dismiss(animated: true, completion: nil)
}
}
2020-06-30 23:15:40.886632+0900 ImageCutter[8367:2065177] [lifecycle ] [u 287F6EF5-DCD3-4CC0-B656-F3D048544B65:m (null)] [com.apple.mobileslideshow.photo-picker(1.0)] Connection to plugin interrupted while in use.
2020-06-30 23:15:40.886938+0900 ImageCutter[8367:2065177] [lifecycle ] [u 287F6EF5-DCD3-4CC0-B656-F3D048544B65:m (null)] [com.apple.mobileslideshow.photo-picker(1.0)] Connection to plugin invalidated while in use.
2020-06-30 23:15:40.887127+0900 ImageCutter[8367:2065007] viewServiceDidTerminateWithError:: Error Domain=_UIViewServiceInterfaceErrorDomain Code=3 "(null)" UserInfo={Message=Service Connection Interrupted}
2020-06-30 23:15:40.887193+0900 ImageCutter[8367:2065007] [Generic] -[PUPhotoPickerHostViewController viewServiceDidTerminateWithError:] Error Error Domain=_UIViewServiceInterfaceErrorDomain Code=3 "(null)" UserInfo={Message=Service Connection Interrupted}
Post not yet marked as solved
Running on:
iMac 27" 5k late 2015 - 64gb ram and a 16tb Pegasus Promise2 R4 raid5 via Thunderbolt.
After trying Big Sur - found issues with Luminar Photo app, decided to return to Catalina on the iMac.
Reformatted my internal drive and reinstalled Catalina 15.5 and reformatted the raid. But I keep getting the following message upon restarting:
"Incompatible Disk. This disk uses features that are not supported on this version of MacOS" and my Pegasus2 R4 portion no longer appears on the desktop or in Disk Utility...
Looked into this and discovered that it may be an issue of Mac OS Extended vs APFS
The iMac was formatted to APFS prior to installing OS11 so I reformatted to APFS when returning to Catalina. The issues persisted so I re-reformatted from a bootable USB - this time to Mac OS Extended (journaled) and the issues seems to be resolved.
The iMac runs slower on MacOS Ext, but it is running and the Raid is recognised...
I'd love to go back to APFS but am afraid it will "break" things.
Any thought on this would be welcome.
Thanks
Nick
Post not yet marked as solved
I'm trying to move a video I create from images within my app from a temporary path to the photo library.
I've verified that the movie exists by downloading the app data via devices/xcode and the movie then plays fine on my macbook.
I've tried:
UISaveVideoAtPathToSavedPhotosAlbum(
videoPath,
self,
#selector(self.video(_:didFinishSavingWithError:contextInfo:)),
nil)
with Error:
Optional(Error Domain=ALAssetsLibraryErrorDomain Code=-1 "Unknown error" UserInfo={NSLocalizedDescription=Unknown error, NSUnderlyingError=0x283684570 {Error Domain=ALAssetsLibraryErrorDomain Code=-1 "Unknown error" UserInfo={NSLocalizedDescription=Unknown error, NSUnderlyingError=0x283681860 {Error Domain=ALAssetsLibraryErrorDomain Code=-1 "Unknown error" UserInfo={NSLocalizedDescription=Unknown error, NSUnderlyingError=0x28366e490 {Error Domain=com.apple.photos.error Code=42001 "(null)"}}}}}})
and
PHPhotoLibrary.requestAuthorization { status in
// Return if unauthorized
guard status == .authorized else {
print("Error saving video: unauthorized access")
return
}
PHPhotoLibrary.shared().performChanges({
PHAssetChangeRequest.creationRequestForAssetFromVideo(atFileURL: videoURL as URL)
}) { success, error in
if !success {
print("Error saving video: \(String(describing: error))")
}
}
}
with Error:
Domain=ALAssetsLibraryErrorDomain Code=-1 "Unknown error" UserInfo= ...... {Error Domain=com.apple.photos.error Code=42001 "(null)"
both compile fine and are called, but end up giving me errors that do not help in the slightest.
I have a full help request on StackOverflow with a link to the project (that it does not let me post here): https://stackoverflow.com/questions/63575539/swift-ios-save-video-to-library
Post not yet marked as solved
Can't save gifs, it just saves frame of it as a photo.
Post not yet marked as solved
I notice that when I open the Photos app on my iPhone 12 Pro, viewing Photos or Videos shot in HDR makes them brighter than the overall display brightness level.
On macOS, there are APIs like EDRMetadata on CAMetalLayer and maximumExtendedDynamicRangeColorComponentValue on NSScreen.
I did see
CAMetalLayer.wantsExtendedDynamicRangeContent, but I'm not sure if this does what I'm looking for.
The "Using Color Spaces to Display HDR Content" - https://developer.apple.com/documentation/metal/drawable_objects/displaying_hdr_content_in_a_metal_layer/using_color_spaces_to_display_hdr_content?language=objc documentation page describes setting the .colorspace on the CAMetalLayer for BT2020_PQ content, but it's not clear if this is referring to macOS or iOS. Is that the right way to get colors to be "brighter" than 1.0 on "XDR" mobile displays?
Post not yet marked as solved
I use the following code to parse Photo metadata and this works well. However, I am unable to pull the new iOS 14 "caption" from this metadata (it worked in early iOS 14 betas, but has since stopped working in the GM.) Does anyone know how I can get the caption data from a PHAsset? Thanks!
Stephen
let options = PHContentEditingInputRequestOptions()
options.isNetworkAccessAllowed = true
asset.requestContentEditingInput(with: options, completionHandler: {(contentEditingInput, _) -> Void in
if let url = contentEditingInput?.fullSizeImageURL {
let fullImage = CIImage(contentsOf: url)
// get all the metadata
self.allPhotoMetadata = fullImage?.properties ?? [:]
// {TIFF}
if let tiffDict = self.allPhotoMetadata["{TIFF}"] as? [String:Any] {
if tiffDict["Make"] != nil {
self.cameraData[cameraKeys.make] = tiffDict["Make"]
}
if tiffDict["Model"] != nil {
self.cameraData[cameraKeys.model] = tiffDict["Model"]
}
if tiffDict["ImageDescription"] != nil {
self.imageData[imageKeys.caption] = tiffDict["ImageDescription"]
}
}
// {IPTC}
if let iptcDict = self.allPhotoMetadata["{IPTC}"] as? [String:Any] {
// if we didn't find a caption in the TIFF dict, try to get it from IPTC data
// first try, Caption/Abtract, then ArtworkContentDescription
if self.imageData[imageKeys.caption] == nil {
if iptcDict["Caption/Abstract"] != nil {
self.imageData[imageKeys.caption] = iptcDict["ArtworkContentDescription"]
} else if iptcDict["ArtworkContentDescription"] != nil {
self.imageData[imageKeys.caption] = iptcDict["ArtworkContentDescription"]
}
}
}
}
})
}
Post not yet marked as solved
HI!
I'm using ImageJ v1,53g for work. It worked smoothly with all versions of Catalina.
However, since I downloaded Big Sur, ImageJ doesn't work properly, crashing only opening 2 images or switching between images.
Does anyone have any suggestion to resolve this issue?
Thanks!
Post not yet marked as solved
Hi,
I have a little issue with this new API PHPPickerViewController:
var configuration = PHPickerConfiguration()
configuration.filter = .any(of: [.images])
configuration.selectionLimit = 10
configuration.preferredAssetRepresentationMode = .compatible
let picker = PHPickerViewController(configuration: configuration)
picker.delegate = self
present(picker, animated: true, completion: nil)
func picker(_ picker: PHPickerViewController, didFinishPicking results: [PHPickerResult]) {
var selectedPhotosData : [Data] = []
for (index,result) in results.enumerated() {
				 result.itemProvider.loadFileRepresentation(forTypeIdentifier: "public.jpeg") { (url, error) in
guard let fileUrl = url else {return }
print(fileUrl)
}
}
This code above doesn't work, I don't get the URL at all. I tried on Simulator and real device but the same problem. I tried loadObject function but I can't the UIImages...
I saw some workarounds here but they don't work in my case it seems...
Post not yet marked as solved
I know how to initialize a UIImage with an SVG from the assets catalog, is there not a way to do it with an SVG downloaded from an API?
UIImage(data: ) fails. So does UIImage(contentsOfFile:)
Why only do this halfway?
Post not yet marked as solved
On an Apple Silicon M1 it is not possible to select the UIImagePicker controller to select an image. In the photo gallery, when you click on the image, the interface does nothing and does not react anything.To exit the interface you must click on the cancel button, but unfortunately it doesn't work also.It's working fine in real device device or intel processor mac simulator with same code and same iOS version.
Currently I am testing on below configuration
System OS: macOS Bigsur(11.2.2)
chip: Apple M1
iOS Simulator: iPhone11(iOS 14.4)
xCode:12.0.4
I get exception like below when i try to select image
NSXPCConnection: 0x60000016a080 connection on anonymousListener or serviceListener from pid 17615: Warning: Exception caught during invocation of selector didSelectMediaWithInfoDictionary:, dropping incoming message and invalidating the connection.
Exception: * -[NSURL URLByAppendingPathExtension:]: component, components, or pathExtension cannot be nil. -[NSURL URLByAppendingPathExtension:]: component, components, or pathExtension cannot be nil.
(
0 CoreFoundation 0x00007fff20421af6 __exceptionPreprocess + 242
1 libobjc.A.dylib 0x00007fff20177e78 objc_exception_throw + 48
2 Foundation 0x00007fff20860900 -[NSURL(NSURLPathUtilities) URLByDeletingPathExtension] + 0
3 PhotosUI 0x00007fff3faf656a -[PUPhotoPickerExtensionHostContext _UIImagePickerControllerInfoDictionaryFromPhotoPickerInfoDictionary:] + 2177
4 PhotosUI 0x00007fff3faf5b5b -[PUPhotoPickerExtensionHostContext didSelectMediaWithInfoDictionary:] + 34
5 Foundation 0x00007fff209290e3 __NSXPCCONNECTION_IS_CALLING_OUT_TO_EXPORTED_OBJECT_S1__ + 10
6 Foundation 0x00007fff20927e1b -[NSXPCConnection _decodeAndInvokeMessageWithEvent:flags:] + 2268
7 Foundation 0x00007fff20929412 message_handler + 206
8 libxpc.dylib 0x00007fff20055cac _xpc_connection_call_event_handler + 56
9 libxpc.dylib 0x00007fff2005603e _xpc_connection_mach_event + 905
10 libdispatch.dylib 0x000000010c73ba68 _dispatch_client_callout4 + 9
11 libdispatch.dylib 0x000000010c755ba8 _dispatch_mach_msg_invoke + 550
12 libdispatch.dylib 0x000000010c7420ad _dispatch_lane_serial_drain + 307
13 libdispatch.dylib 0x000000010c756a76 _dispatch_mach_invoke + 563
14 libdispatch.dylib 0x000000010c7420ad _dispatch_lane_serial_drain + 307
15 libdispatch.dylib 0x000000010c742f9d _dispatch_lane_invoke + 493
16 libdispatch.dylib 0x000000010c74ede2 _dispatch_workloop_worker_thread + 882
17 libsystem_pthread.dylib 0x00007fff61167499 _pthread_wqthread + 314
18 libsystem_pthread.dylib 0x00007fff61166467 start_wqthread + 15
)
Eager for this to be fixed out, it is really unbelievable issue. Kindly help me to solve this.
Post not yet marked as solved
We implemented the new PHPicker and have run into an issue we haven't been able to replicate on our own devices but see a lot of users running into it. The problem is an error after getting the PHPickerResults and trying to get the UIImages.
Because the user can select several images at once, what we do is get the results and iterate over each itemProvider object.
I'm following apple's guidance and checking if itemProvider canLoadObjectOfClass:UIImage.class, before executing itemProvider loadObjectOfClass:UIImage.class.
However we are getting hundreds of reports of users where this last method returns an error.
Firstly, this is how we configure our PHPickerViewController:
PHPickerConfiguration *configuration = [[PHPickerConfiguration alloc] init];
configuration.selectionLimit = self.pictureSelectionLimit;
configuration.filter = PHPickerFilter.imagesFilter;
configuration.preferredAssetRepresentationMode = PHPickerConfigurationAssetRepresentationModeCurrent;
PHPickerViewController *pickerViewController = [[PHPickerViewController alloc] initWithConfiguration:configuration];
pickerViewController.delegate = self;
pickerViewController.modalPresentationStyle = UIModalPresentationFullScreen;
[viewController presentViewController:pickerViewController
animated:YES
completion:nil];
And this is what we do with the PHPickerResult. This is a method that returns a block with an array of an object NewPicture instantiated with the UIImage I should be getting.
NSMutableArray *picArray = [[NSMutableArray alloc] init];
NSArray *itemProviders = [self.results custom_map: ^id _Nullable (PHPickerResult *_Nonnull current) {
return current.itemProvider;
}];
dispatch_group_t dispatchGroup = dispatch_group_create();
for (NSItemProvider *itemProvider in itemProviders) {
dispatch_group_enter(dispatchGroup);
/**
We cannot properly retrieve raw type images with the current authorization status.
If the image is of type raw, we ignore it.
*/
if ([itemProvider hasItemConformingToTypeIdentifier:@"public.camera-raw-image"]) {
NSException *exception = [NSException exceptionWithName:@"ImageIsTypeRaw"
reason:[NSString stringWithFormat:@"Object is type raw. ItemProvider: %@", itemProvider.description]
userInfo:nil];
// Log exception...
dispatch_group_leave(dispatchGroup);
continue;
}
if ([itemProvider canLoadObjectOfClass:UIImage.class]) {
[itemProvider loadObjectOfClass:UIImage.class completionHandler: ^(__kindof id NSItemProviderReading _Nullable object, NSError *_Nullable error) {
if ([object isKindOfClass:UIImage.class]) {
NewPicture *picture = [[NewPicture alloc]initWithImage:object];
[picArray addObject:picture];
}
if (error) {
NSException *exception = [NSException exceptionWithName:@"CouldNotLoadImage"
reason:[NSString stringWithFormat:@"Object is nil. UserInfo: %@", error.userInfo]
userInfo:error.userInfo];
// Log exception...
}
dispatch_group_leave(dispatchGroup);
}];
}
}
dispatch_group_notify(dispatchGroup, dispatch_get_main_queue(), ^{
picturesBlock(picArray);
});
The most common error we see our users are getting is:
Object is nil. UserInfo: {
NSLocalizedDescription = "Cannot load representation of type public.jpeg";
NSUnderlyingError = "Error Domain=NSCocoaErrorDomain Code=260 \"The file \U201cversion=1&uuid=*&mode=current.jpeg\U201d couldn\U2019t be opened because there is no such file.\" UserInfo={NSURL=file:///private/var/mobile/Containers/Shared/AppGroup/*/File%20Provider%20Storage/photospicker/version=1&uuid=*&mode=current.jpeg, NSFilePath=/private/var/mobile/Containers/Shared/AppGroup/*/File Provider Storage/photospicker/version=1&uuid=***&mode=current.jpeg, NSUnderlyingError=0x283822970 {Error Domain=NSPOSIXErrorDomain Code=2 \"No such file or directory\"}}";
}
I'm having a really hard time understanding why this sometimes fails. I'd really appreciate it if someone could give me a hand with this.
I'm attaching the stack trace:
stack_trace - https://developer.apple.com/forums/content/attachment/051f7018-05ff-4ad1-a626-29f248d0b497
Post not yet marked as solved
I think the image resizing process when creating the new contact is not done correctly.
It's easy to understand if you create a vCard.
[Steps] Take two pictures with the same subject. (Let "IMG_A" and "IMG_B".)
Create a "New Contact".
2-1. Tap [Add Photo] and select "IMG_A".
2-2. Tap the [Choose] without doing anything in "Move and Scale".
2-3. Tap [Done] a few times to set the Photo.
2-4. Entering a name and other information is optional.
3. Save the contact as a vcf file to Files App.
* [Share Contact] - [Save to Files] - [On My iPhone] - [Save]
4. Edit the contact that saved at step 2.
4-1. Release "IMG_A", and set the "IMG_B" in the same as the step 2-1 to 2-3.
5. Save the contact as a vcf file to Files app in the same as step 3.
6. Check the size of the two vcf files.
[Result]
The size of the two vcf files are very different.
I think the cause is PHOTO property.
As a result of extracting the image from vCard, the resolution was as follows.
(Original: 3024 * 4032)
IMG_A: 2784 * 2784
IMG_B: 320 * 320
[Remarks]
I checked this issue occur iOS14(include new version of 14.4.2) and iOS12 is not occured.
Post not yet marked as solved
In the "Explore Core Image kernel improvements" session, David mentioned that it is now possible to compile [[stitchable]] CI kernels at runtime. However, I fail to get it working.
The kernel requires the #import of <CoreImage/CoreImage.h> and linking against the CoreImage Metal library. But I don't know how to link against the library when compiling my kernel at runtime. Also, according to the Metal Best Practices Guide, "the #include directive is not supported at runtime for user files."
Any guidance on how the runtime compilation works is much appreciated! 🙂
Post not yet marked as solved
Hello, when I use Photogrammetry, I receive this error:
Error creating session: cantCreateSession("Native session create failed: CPGReturn(rawValue: -11)") .
My specs are listed below. I think My macBook Pro should be supported. Please let me know if I missed something or if there is a fix for the issue.
Model Name: MacBook Pro (2019)
Model Identifier: MacBookPro15,2
Processor Name: Quad-Core Intel Core i7
Processor Speed: 2.8 GHz
Number of Processors: 1
Total Number of Cores: 4
L2 Cache (per Core): 256 KB
L3 Cache: 8 MB
Hyper-Threading Technology: Enabled
Memory: 16 GB
Post not yet marked as solved
In iOS 14, Live Photo could display as video in the photo album generated memories, but in iOS 15, the Live Photo is display as still photo in the memories, made it more like a slide show instead of lively memories like it used to be. The great feature of Live Photo should be harness and display as video in the memories generated by the photo app.
Live Photo became still photo in memories, really downgraded the value of the photos and the memories.
Post not yet marked as solved
My app helps its user scan hundreds of photos. I want to present a PHPickerViewController so that the user doesn't have to scroll through hundreds of photos to find the next photo they want to scan. The scroll criteria could be a date or assetIdentifier.
Post not yet marked as solved
When using PHPickerViewController to load images from my photo library, several photos fail with:
Error Domain=NSItemProviderErrorDomain Code=-1200 "Could not coerce an item to class UIImage" UserInfo={NSLocalizedDescription=Could not coerce an item to class UIImage}
It appears to happen consistently on specific photos, even after restarting the device. I've set the PHPickerFilter to .images on the config, so I wouldn't expect casting to UIImage to be a problem.
In what scenario would casting to UIImage fail when the .image filter is set? There's nothing obviously different about the photos that receive this error. In fact, other photos taken as part of the same series work just fine.
Also, it's worth noting that these photos are part of a shared album.
Post not yet marked as solved
I updated my MacBook Pro (13-inch, 2017, Four Thunderbolt 3 Ports, Processor: 3.1 GHz Dual-Core Intel Core i5,
Memory 8 GB 2133 MHz LPDDR3) to macOS Big Sur Version 11.5.1 recently. Ever since, my Photos Libraries on External Hard drives cannot be opened. The "PHPhotosErrorInvalidState" message keeps appearing. Even when I tried to create a new library, the same message would appear. HELP!!! I have over 10 years of photos/videos stored on many external hard drives that cannot be accessed now. All of my past few months of works are also stored on these libraries which cannot be opened now. URGENTLY NEED HELP!!!!