AGImagePickerController icon indicating copy to clipboard operation
AGImagePickerController copied to clipboard

I fixed all bugs

Open zoelounge opened this issue 11 years ago • 8 comments

Hi friends, I fixed all bugs. I will upload the files as soon as possible.

zoelounge avatar Sep 28 '13 07:09 zoelounge

Zoelounge, Where are you uploading the files to?

carterminearIMT avatar Sep 30 '13 13:09 carterminearIMT

Hello Zoelounge. Does it fixes the "funky rotation problems" reported by the user StayHungryApps in the "No thumnails are shown on iOS7" thread? Some uiviewtable cells are overlapping when the device orientation changes. Thank you.

stephanelx avatar Sep 30 '13 13:09 stephanelx

Ok boys, i'm going to add the code that fix all bugs.

Excuse my English ok!?

I resolve 2 bugs: 1 - toolbar "select all" and "deselect al" 2 - Gost image.

Sorry stephanelx, I didn't notice about "funky rotation problems" maybe because i use landscape modei only on iPad, and i didn't use Landscape mode on iPhone.

Before you start you can download the project from https://github.com/mokten/AGImagePickerController and then apply the code below:

In AGIPCAsstesControl.m change the method - (NSArray *)itemsForRowAtIndexPath:(NSIndexPath *)indexPath with the method below:

  • (NSArray *)itemsForRowAtIndexPath:(NSIndexPath *)indexPath { NSMutableArray *items = [NSMutableArray arrayWithCapacity:self.imagePickerController.numberOfItemsPerRow];

    NSUInteger startIndex = indexPath.row * self.imagePickerController.numberOfItemsPerRow, endIndex = startIndex + self.imagePickerController.numberOfItemsPerRow - 1;

// THI IS THE CODE WITH THE BUG // if (startIndex < self.assets.count ) // { // if (endIndex > self.assets.count - 1) // endIndex = self.assets.count - 1; //
// for (NSUInteger i = startIndex; i <= endIndex; i++) // { // [items addObject:(self.assets)[i]]; // } // } // Zoe: i have add this snippet of code:

if (startIndex < (double)self.assetsGroup.numberOfAssets)
{
    if (endIndex > (double)self.assetsGroup.numberOfAssets - 1)
        endIndex = (double)self.assetsGroup.numberOfAssets - 1;

    for (NSUInteger i = startIndex; i <= endIndex; i++)
    {

        [items addObject:(self.assets)[i]];
    }
}
return items;

}

In the same file change method -(loadAssets) with the method below

  • (void) loadAssets { [self.assets removeAllObjects];

    [self.assetsGroup enumerateAssetsUsingBlock:^(ALAsset *result, NSUInteger index, BOOL *stop) {

    AGIPCGridItem *gridItem = [[AGIPCGridItem alloc] initWithImagePickerController:self.imagePickerController asset:result andDelegate:self];
    
    
     if ( self.imagePickerController.selection != nil && [self.imagePickerController.selection containsObject:result])
     {
         gridItem.selected = YES;
     }
    

// Zoe resolve bug about toolbar for "select all" and "deselect all"

    if(index < (double)self.assetsGroup.numberOfAssets){


        [self.assets addObject:gridItem];

    }

}]; 
dispatch_async(dispatch_get_main_queue(), ^{
        [self reloadData];
});

I hope I have helped some of you.

good night.

zoelounge avatar Oct 01 '13 23:10 zoelounge

It's allright zoelounge, anyway I found the problem with orientation changes. Using dequeueReusableCellWithIdentifier when initializing UITableView cells was causing this weird behavior. Until I find a better solution, I'll simply avoid using it.

stephanelx avatar Oct 02 '13 19:10 stephanelx

Stephanelx i'm sorry but i din't have the orientation problem. Can you tell me wich is the problem in a fee word?

Can you send me a video about the problem ? Best

zoelounge avatar Oct 02 '13 19:10 zoelounge

Sure! The problem occur when I am changing the orientation of the ios device. Thumbnails are not positioned correctly. Images are overlapping as you can see in the following screenshot: agimagepickercontroller_orientationbug

stephanelx avatar Oct 04 '13 12:10 stephanelx

Great work! Thank you for the fixes.

joshreeder avatar Feb 11 '14 19:02 joshreeder

Zoe have you solved this? : Take picture from device camera, edit it with camera control (apply filter etc). save it in photo library. now launch your app. get that edited image from library using AGImagePicker. assign to some image view. no edit effects feels here.

(ios 7)

joshreeder avatar Feb 11 '14 19:02 joshreeder