Telerik-Verified-Plugins / ImagePicker

Cordova Plugin For Multiple Image Selection
MIT License
182 stars 331 forks source link

Ios Thumbnail Graphic Problem #143

Closed Soapfedan closed 5 years ago

Soapfedan commented 6 years ago

I have an Ionic project that uses this plugin. The plugin on Android has no problem.

But now I'm using it on Ios and I have a problem. When I select an image inside the album, the following behavior happens:

image

Now if I deselect that image and select another one, (without leaving the page), it happens that the thumbnails lose their desired size and assume their natural size:

image

My Ionic Info

cli packages: (my_node_path\npm\node_modules)

@ionic/cli-utils : 1.19.2 ionic (Ionic CLI) : 3.20.0 local packages:

@ionic/app-scripts : 3.1.9 Cordova Platforms : android 7.0.0 Ionic Framework : ionic-angular 3.9.2 System:

Node : v9.9.0 npm : 5.6.0 OS : Windows 10

Someone can help me?

matheustavaresdev commented 5 years ago

Had the same issues. No idea of what to do... Thinking of moving out of ionic though...

jmarbutt commented 5 years ago

I am having the same issue, have you found any solution?

Soapfedan commented 5 years ago

Yeah, now i use the HTML5 File API, i think that this native plugin is not ok for iOS.

I hope you find a solution for this trouble.

Jetro223 commented 5 years ago

Same problem here - the behaviour appeared with iOS12.

jayinai commented 5 years ago

same here

abhayjaniit commented 5 years ago

Same Here ..

ktt9117 commented 5 years ago

same here It happens when I select some image and then unselect it and then select it again.

ktt9117 commented 5 years ago

same here It happens when I select some image and then unselect it and then select it again.

I found out that things happen when this code is executed.

GMImagePickerController.m


-(void)updateToolbar {

    UINavigationController *nav = (UINavigationController *)self.childViewControllers[0];

    for (UIViewController *viewController in nav.viewControllers) {

        [[viewController.toolbarItems objectAtIndex:1] setTitle:[self toolbarTitle]];

        [viewController.navigationController setToolbarHidden:(self.selectedAssets.count == 0) animated:YES];

    }

}

But I do not know how to fix it. In my case, I annotated them.

quangpdt commented 5 years ago

Thanks @ktt9117 for your hint. Cause we're all not iOS devs originally, so I don't have enough knowledge to fix this issue. What I think I can do is waiting for the fix (May never happen) or just disable the toolbar for displaying number of Selected image. Just need to switch value of _displaySelectionInfoToolbar from YES to NO.

And there's one more thing that I found out, this issue only happens on iOS 12, iOS 11 still works perfectly

eeenbnb commented 5 years ago

Thumbnail bug fix.

GMAlbumsViewCell.m edit this line.

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    //[super setSelected:selected animated:animated];
    // Configure the view for the selected state
}

and, this add.

- (void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated {
    if( highlighted ) {
        [self setBackgroundColor:[UIColor lightGrayColor]];
    } else {
        [self setBackgroundColor:[UIColor whiteColor]];
    }
}

selected Graphic bug fix.

GMGridViewCell.m

- (id)initWithFrame:(CGRect)frame
{
    ...
        // The image view
        ....
        //_imageView.translatesAutoresizingMaskIntoConstraints = NO;
        //_imageView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
        ...
}

this line comment out.

shubhambaghel34 commented 5 years ago

I have gone through the code also tried controller changes still I am facing the same issue over ios 12.3

MayankLogiciel commented 5 years ago

I am able to fix both issues

  1. Thumbnail bug fix : using suggested code by @eeenbnb in above comment
  2. Ios Album Selection Graphic Bug # 142 by using code changes from this commit https://github.com/guillermomuntaner/GMImagePicker/commit/1a309e4ea017c1b9b6ae97952bcc367b62026444

Thanks @eeenbnb & @guillermomuntaner

You can use code from below branch https://github.com/MayankLogiciel/ImagePicker/commits/jp_2.3.2

But this plugin still suffers the one more issue, where selection of images sometimes takes too long.

shubhambaghel34 commented 5 years ago

@MayankLogiciel Tell me whole process how to edit plugin files like Gridviewcell.m and others and after that what we need to do. I have done changes in my plugin folder for Telerik plugin in Gridviewcell and Gridview controller files still I'm facing the same issue trying issue since last week. Cordova plugin version of Telerikplugin is 2.3.2. ionic en

mayank-aika commented 5 years ago

@shubhambaghel34 - I believe after making code changes to the files, you have to run cordova prepare command, so these changes get reflected in Platform plugin folder as well.

Other Solutions:

Either you can simply install and use the the forked version from here https://github.com/MayankLogiciel/ImagePicker#jp_2.3.2

OR you first need to fork this plugin yourself, then change files code, commit. Then simply install plugin from your own repo.

anujraghuvanshi commented 5 years ago

This Issue has been fixed in v2.3.3, Hence closing the issue. Thanks for using the plugin.