0

I used ELCImagePicker with my APP I faced two problems the first one when gallery appear view not equal to the width of iPhone or iPad like image blow, the second one images that appear in gallery are pixeled not on the normal resolution.enter image description here

//----------------------------------------------------
//imagePicker Zone
- (IBAction)uploadImageActionButton:(id)sender {

    ELCImagePickerController *elcPicker = [[ELCImagePickerController alloc] initImagePicker];

    elcPicker.maximumImagesCount = 5; //Set the maximum number of images to select to 100
    elcPicker.returnsOriginalImage = YES; //Only return the fullScreenImage, not the fullResolutionImage
    elcPicker.returnsImage = YES; //Return UIimage if YES. If NO, only return asset location information
    elcPicker.onOrder = YES; //For multiple image selection, display and return order of selected images
    elcPicker.mediaTypes = @[(NSString *)kUTTypeImage, (NSString *)kUTTypeMovie]; //Supports image and movie types

    elcPicker.imagePickerDelegate = self;

    [self presentViewController:elcPicker animated:YES completion:nil];
}
- (void)elcImagePickerController:(ELCImagePickerController *)picker didFinishPickingMediaWithInfo:(NSArray *)info
{//yes
    [self dismissViewControllerAnimated:YES completion:nil];

//    
    NSMutableArray *images = [NSMutableArray arrayWithCapacity:[info count]];
     NSMutableArray *name = [NSMutableArray arrayWithCapacity:[info count]];
    NSMutableArray *path = [NSMutableArray arrayWithCapacity:[info count]];
    NSString *aDocumentsDirectory = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject];
    NSInteger anIndex = 0;

    for(NSDictionary *dict in info) {
        UIImage *image = [dict objectForKey:UIImagePickerControllerOriginalImage];
        [images addObject:image];

        UIImageView *imageview = [[UIImageView alloc] initWithImage:image];
        [imageview setContentMode:UIViewContentModeScaleAspectFit];
        // Save Image
        NSString *anImageName = [NSString stringWithFormat:@"%ld.jpg", 1+(long)anIndex++];
        NSString *anImagePath = [NSString stringWithFormat:@"%@/%@", aDocumentsDirectory, anImageName];

        NSData *anImageData = UIImageJPEGRepresentation(image, 0.5);
        [anImageData writeToFile:anImagePath atomically:YES];
        [path addObject:anImagePath];
        [images addObject:anImageData];
    }

    _chosenImages=images;
    _chosenImagesName=name;
    _chosenImagesPath=path;
    NSLog(@"name %@",_chosenImagesName);

}

- (void)elcImagePickerControllerDidCancel:(ELCImagePickerController *)picker
{//yes
    [self dismissViewControllerAnimated:YES completion:nil];
}
Ahmed Abdallah
  • 2,338
  • 1
  • 19
  • 30
  • 1
    Please provide some code as how are presenting the imagepicker. – Milan Gupta Mar 09 '16 at 12:26
  • This is the issue in the library classes. In ELCAssetCell, the cell size is defined as 75*75, however they are not appropriate for the iPad width. May be you can open issue at github and wait for the fix. – Milan Gupta Mar 10 '16 at 06:11

0 Answers0