CTAsssetspickerController not fetching modified images from Gallery

21 views Asked by At

If i edit an image in photos app by adding marker and changing filters and try to attach the same photo in my iOS application , it shows all the images when pickercontroller opens up the gallery but when the same edited/modified image is attached. it doesnt show up those marker and added filters in the added cell image. I am using CTAssetspicker controller.

-(void)showPhotoLibraryForType:(NSString *)type{
        // request authorization status
        NSUserDefaults *userdefaults   = [NSUserDefaults standardUserDefaults];
       
        [PHPhotoLibrary requestAuthorization:^(PHAuthorizationStatus status){
            dispatch_async(dispatch_get_main_queue(), ^{
                [self hideOnlinestatusView];
                // init picker
                 CTAssetsPickerController *picker = [[CTAssetsPickerController alloc] init];
                picker.delegate = self;
                
                if ([type isEqualToString:filetypevideos]) {
                    [userdefaults setObject:@"2" forKey:@"mediaType"];
                    [userdefaults synchronize];
                    NSString *count = APP_DELEGATE.settings.dict[@"MaxVideoSelectionMobile"];
                    if (count) {
                        picker.totalAssets = [count integerValue];
                    }
                    NSString *maxLimitSize = APP_DELEGATE.settings.dict[@"MaxSizeOfVideoMobile"];
                    if (maxLimitSize) {
                        picker.maxLimitSize =  [maxLimitSize integerValue]  * 1048576;    //150000000;   // 150MB
                    }
                }
                else{
                    [userdefaults setObject:@"1" forKey:@"mediaType"];
                    [userdefaults synchronize];
                    BOOL showOldDocument = [APP_DELEGATE.settings.dict[@"ShowOldDocumentManagment"] boolValue];
                    if (!showOldDocument) {
                        NSString *count = APP_DELEGATE.settings.dict[@"MaxImageSelectionMobile"];
                        if (count) {
                            picker.totalAssets = [count integerValue];
                        }
                        NSString *maxLimitSize = APP_DELEGATE.settings.dict[@"MaxSizeOfImageMobile"];
                        if (maxLimitSize) {
                            picker.maxLimitSize =  [maxLimitSize integerValue]  * 1000000;    //10000000;   // 150MB
                        }
                    }
                }
               
                picker.showNewDocuments = YES ;
                
                // create options for fetching photo only
                PHFetchOptions *fetchOptions = [PHFetchOptions new];
                
            
                if ([type isEqualToString:filetypeimages])
                {
                    fetchOptions.predicate = [NSPredicate predicateWithFormat:@"mediaType == %d", PHAssetMediaTypeImage];
                }
                else if ([type isEqualToString:filetypevideos])
                {
                    fetchOptions.predicate = [NSPredicate predicateWithFormat:@"mediaType == %d", PHAssetMediaTypeVideo];
                    
                }
                
                fetchOptions.includeAssetSourceTypes=PHAssetSourceTypeUserLibrary;
                // assign options
                picker.assetsFetchOptions = fetchOptions;
                
                // hide empty albums
                picker.showsEmptyAlbums = NO;
                // to show selection order
                picker.showsSelectionIndex = YES;
                // Optionally present picker as a form sheet on iPad
                if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
                    picker.modalPresentationStyle = UIModalPresentationFormSheet;
                // present picker
                [self presentViewController:picker animated:YES completion:nil];
                
            });
        }];
    }
0

There are 0 answers