Giter Site home page Giter Site logo

roycornelissen / gmimagepicker.xamarin Goto Github PK

View Code? Open in Web Editor NEW
72.0 5.0 39.0 9.17 MB

Port of the original GMImagePicker component to Xamarin.iOS

License: MIT License

C# 100.00%
ios mobile xamarin-ios xamarin csharp image-selector images photo-gallery iphone ipad

gmimagepicker.xamarin's Introduction

roycornelissen

My profile

gmimagepicker.xamarin's People

Contributors

brenobaronte avatar csamzhou avatar cybrosys avatar duranom avatar dustintnguyen avatar henziger avatar ish-1313 avatar jasonctoms avatar jose7777 avatar karimeljed avatar metaine avatar osc117 avatar pragmatrix avatar roycornelissen avatar searachen avatar sergbuk avatar suawek2 avatar thomashilbertatcervis avatar x-sheep avatar zs40x avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

gmimagepicker.xamarin's Issues

Navigation bar does not show images behind it blurred

In the normal "Photos" app, and many others, the images (or other graphical objects) are placed behind the navigation bar when scrolling down; the Navigation bar is by default translucent with the blur effect. For some reason it doesn't look the same with GMImagePicker.

image

Review and update translations for it - Italian

Up for grabs: please review and update/complete the translations in the it.lproj/GMImagePicker.strings file for the language it (Italian). Use the original labels in Base.lproj as a starting point.

Contributions are highly appreciated!

Review and update translations for de - German

Up for grabs: please review and update/complete the translations in the de.lproj/GMImagePicker.strings file for the language de (German). Use the original labels in Base.lproj as a starting point.

Contributions are highly appreciated!

Add missing translations for language of your choice

Up for grabs: if you find any language missing in this library and are willing to contribute translations for it, please make a PR.

Add a ??.lproj folder to the GMImagePicker project, with a file named GMImagePicker.strings in it and complete the translations for that language. Use the original labels in Base.lproj as a starting point.

Don't forget to set the build action for the GMImagePicker.strings file to BundleResource.

Contributions are highly appreciated!

Crash when take a picture from Camera.

When take a picture from Camera - crash:
Xamarin.iOS: Received unhandled ObjectiveC exception: NSInternalInconsistencyException threading violation: expected the main thread

I've tried put code inside InvokeOnMainThread and DispatchQueue.MainQueue.DispatchAsync - didn't help.

Review and update translations for pt - Portuguese

Up for grabs: please review and update/complete the translations in the pt.lproj/GMImagePicker.strings file for the language pt (Portuguese). Use the original labels in Base.lproj as a starting point.

Contributions are highly appreciated!

How to remove unwanted localizations?

Hello.
How can I remove localizations, which my app does not support? I don't want them to appear on App Store. Is the only way is to include this project into my solution, or it could be done with the nuget package?

Can't install NuGet package

I am trying to install your library through NuGet in my Xamarin Forms project. I get this error during the installation process:
Package GMImagePicker.Xamarin 2.1.0 is not compatible with netstandard2.0 (.NETStandard,Version=v2.0). Package GMImagePicker.Xamarin 2.1.0 supports: xamarinios10 (Xamarin.iOS,Version=v1.0)

What should I do to install your package?

CameraButton always takes pictures

The MediaType for the camera button is fixed to Image. So you can't record a new video when you set your MediaType to video.

I already fixed it in my fork and will create a pull request for it.

Limit the number of selectable images

Is there a way to limit the number of total selectable images?
For example, in my case, I need to limit the selection to five images. Is it achievable in some way?

Behaviour for new camera images is incomplete

When the current view is not the GMGridViewController for the "all photos" gallery, a new image captured by the camera is not automatically selected. Also, if current view is GMAlbumsViewController, the picker doesn't automatically navigate to the "all photos" gallery to highlight the changes.

When GridSortOrder == Ascending, the new camera image is not correctly scrolled into view.

picker.SelectedAssets.Clear(); not working?

I want to clear selected image of last time.
I have try set _preselectedAssets = null at the end of Finished func, It's work BUT what happend when user open picker many time?

I try generate picker onetime in ctor and try clear pre-selected assets by picker.SelectedAssets.Clear(); but it's not working.

Review and update translations for pl - Polish

Up for grabs: please review and update/complete the translations in the pl.lproj/GMImagePicker.strings file for the language pl (Polish). Use the original labels in Base.lproj as a starting point.

Contributions are highly appreciated!

How to set Back button Title

Hi,

I want to set back button title is null. But GMImagePickerController Option can't found it. Can you have this option?

Crash when picking video from iCloud

Hello roycornelissen,
I have a problem using your ImagePicker, these are the steps to reproduce on our app:

·Select a video from picker that is stored on iCloud and not in the device
·Request to download it
·Everything is ok here
·Open again the imagePicker and try to download another video from iCloud
·Application crashes natively like this:

2018-09-05 12:24:48.373 [308:19476] critical: at <unknown> <0xffffffff> 2018-09-05 12:24:48.384 [308:19476] critical: at (wrapper managed-to-native) ObjCRuntime.Messaging.void_objc_msgSend_IntPtr_IntPtr (intptr,intptr,intptr,intptr) <0x0004b> 2018-09-05 12:24:48.392 [308:19476] critical: at UIKit.UICollectionView.PerformBatchUpdates (System.Action,UIKit.UICompletionHandler) [0x0005f] in /Users/builder/data/lanes/5665/db807ec9/source/xamarin-macios/src/build/ios/native/UIKit/UICollectionView.g.cs:552 2018-09-05 12:24:48.395 [308:19476] critical: at iOS.GMImagePicker.GMGridViewController/<>c__DisplayClass28_0.<PhotoLibraryDidChange>b__0 () [0x000c5] in iOS/GMImagePicker/GMGridViewController.cs:378 2018-09-05 12:24:48.404 [308:19476] critical: at CoreFoundation.DispatchQueue.static_dispatcher_to_managed (intptr) [0x0003d] in /Users/builder/data/lanes/5665/db807ec9/source/xamarin-macios/src/CoreFoundation/Dispatch.cs:343 2018-09-05 12:24:48.408 [308:19476] critical: at (wrapper native-to-managed) CoreFoundation.DispatchQueue.static_dispatcher_to_managed (intptr) <0x000e3> 2018-09-05 12:24:48.408 [308:19476] critical: at <unknown> <0xffffffff> 2018-09-05 12:24:48.411 [308:19476] critical: at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain (int,string[],intptr,intptr) <0x0004f> 2018-09-05 12:24:48.412 [308:19476] critical: at UIKit.UIApplication.Main (string[],intptr,intptr) [0x00005] in /Users/builder/data/lanes/5665/db807ec9/source/xamarin-macios/src/UIKit/UIApplication.cs:79 2018-09-05 12:24:48.413 [308:19476] critical: at UIKit.UIApplication.Main (string[],string,string) [0x00038] in /Users/builder/data/lanes/5665/db807ec9/source/xamarin-macios/src/UIKit/UIApplication.cs:63 2018-09-05 12:24:48.414 [308:19476] critical: at iOS.Application.Main (string[]) [0x00001] in Main.cs:18 2018-09-05 12:24:48.418 [308:19476] critical: at (wrapper runtime-invoke) object.runtime_invoke_dynamic (intptr,intptr,intptr,intptr) [0x0001e] in <d680a8bf3a2a4c8dbbfde665ba81f6f2#A683D333-58E2-40DC-F898-4B3DAA7253C3>:0 2018-09-05 12:24:48.419 [308:19476] critical:

I couldn't find who is calling UIKit.UICollectionView.PerformBatchUpdates on GMGridViewController.
Which I guess is causing the native crash.
Note that this is not happening if the file requested is stored on the device.

Any help will be appreciated,

thanks and congratulations for this component 👍

Customize the imagepicker view

Hi I want to customize the picker view but i can't find how,

basically i want to completely change the navigation bar and add one button at the bottom. is this possible with this component ?

thanks a lot

Translations not working

When a user launches the GMImagePicker and tries to select Albums and they did not give the app permission to photos they are greeted with a NO TRANSLATION error message.

It appears to be an issue with the way we have configured our app. I added the localizations to the plist file, but that doesn't fix it. Is there any specific configuration I need for the translations to work?

Review and update translations for fr - French

Up for grabs: please review and update/complete the translations in the fr.lproj/GMImagePicker.strings file for the language fr (French). Use the original labels in Base.lproj as a starting point.

Contributions are highly appreciated!

Review and update translations for en - English

Up for grabs: please review and update/complete the translations in the en.lproj/GMImagePicker.strings file for the language en (English). Use the original labels in Base.lproj as a starting point.

Contributions are highly appreciated!

Issue after upgrading to iOS 13 iPhone

My app is crashing after iOS 13 update when I tried to use GMImagePicker. It was working fine in the earlier versions.
Doing debug found out that

PHImageManager imageManager = new PHImageManager();
imageManager.RequestImageData()

PhImageDataHandler is returning null data.

As a notice on the iPad version of the app is working as expected, only the iPhone version of the app is having problem

Version 2.3.3 appears unsigned on Nuget

After upgrading to 2.3.3, when building our Xamarin app through TFS 2017, we began to receive these error messages. Has the latest version posted to Nuget been signed?

2019-04-17T18:17:38.2313370Z Installing GMImagePicker.Xamarin 2.3.3.
2019-04-17T18:17:38.2453550Z PackageSignatureVerificationLog: PackageIdentity: GMImagePicker.Xamarin.2.3.3 Source: https://api.nuget.org/v3/index.json PackageSignatureValidity: False
2019-04-17T18:17:38.2507960Z NU3004: Package 'GMImagePicker.Xamarin 2.3.3' from source 'https://api.nuget.org/v3/index.json': This repository indicated that all its packages are repository signed; however, this package is unsigned.

...snipped...

2019-04-17T18:17:38.6266450Z Errors in /Agent/_work/1/s/MyProj.csproj
2019-04-17T18:17:38.6278220Z     NU3004: Package 'GMImagePicker.Xamarin 2.3.3' from source 'https://api.nuget.org/v3/index.json': This repository indicated that all its packages are repository signed; however, this package is unsigned.
2019-04-17T18:17:38.6291120Z     NU3004: Package 'GMImagePicker.Xamarin 2.3.3' from source 'https://api.nuget.org/v3/index.json': This repository indicated that all its packages are repository signed; however, this package is unsigned.

Does Xamarin forms IOS supports this package?

Before upgrading from PCL to .NetStandard, it worked on xamarin forms ios.
But now it is not working and here is my code:

public async Task OpenGallery()
{
var picker = new GMImagePickerController
{
Title = "Custom Title",
CustomDoneButtonTitle = "Finished",
CustomCancelButtonTitle = "Nope",
CustomNavigationBarPrompt = "Take a new photo or select an existing one!",
ColsInPortrait = 3,
ColsInLandscape = 5,
MinimumInteritemSpacing = 2.0f,
DisplaySelectionInfoToolbar = true,
AllowsMultipleSelection = true,
ShowCameraButton = true,
AutoSelectCameraImages = true,
AllowsEditingCameraImages = true,
ModalPresentationStyle = UIModalPresentationStyle.Popover,
MediaTypes = new[] { PHAssetMediaType.Image },
};

        // You can limit which galleries are available to browse through
        picker.CustomSmartCollections = new[] {
            PHAssetCollectionSubtype.SmartAlbumUserLibrary,
            PHAssetCollectionSubtype.AlbumRegular
        };

        if (_preselectedAssets != null)
        {
            foreach (var asset in _preselectedAssets)
            {
                picker.SelectedAssets.Add(asset);
            }
        }

        // Event handling
        picker.FinishedPickingAssets += Picker_FinishedPickingAssets;
        picker.Canceled += Picker_Canceled;

        // Other events to implement in order to influence selection behavior:
        // Set EventArgs::Cancel flag to true in order to prevent the action from happening
        picker.ShouldDeselectAsset += (s, e) => { /* allow deselection of (mandatory) assets */ };
        picker.ShouldEnableAsset += (s, e) => { /* determine if a specific asset should be enabled */ };
        picker.ShouldHighlightAsset += (s, e) => { /* determine if a specific asset should be highlighted */ };
        picker.ShouldShowAsset += (s, e) => { /* determine if a specific asset should be displayed */ };
        picker.ShouldSelectAsset += (s, e) => { /* determine if a specific asset can be selected */ };

        picker.AssetSelected += (s, e) => { /* keep track of individual asset selection */ };
        picker.AssetDeselected += (s, e) => { /* keep track of individual asset de-selection */ };

        // GMImagePicker can be treated as a PopOver as well:
        var popPC = picker.PopoverPresentationController;
        popPC.PermittedArrowDirections = UIPopoverArrowDirection.Any;
        await PresentViewControllerAsync(picker, true);
    }

Review and update translations for ca - Catalan

Up for grabs: please review and update/complete the translations in the ca.lproj/GMImagePicker.strings file for the language ca (Catalan). Use the original labels in Base.lproj as a starting point.

Contributions are highly appreciated!

Inaccurate Asset Counts for Collections

When showing the collections in the album view, the totals only show a maximum of 3.

Collections only show 3 images max.
image

How many images are actually in the collection.
image

I believe it's because you are calling PHAssets.FetchKeyAssets instead of PHAssets.FetchAssets like you are doing in the "Camera Roll" call, but I don't know what the ramifications of changing that call.

Review and update translations for zh-Hans - Chinese

Up for grabs: please review and update/complete the translations in the zh-Hans.lproj/GMImagePicker.strings file for the language zh-Hans (Chinese). Use the original labels in Base.lproj as a starting point.

Contributions are highly appreciated!

Review and update translations for es - Spanish

Up for grabs: please review and update/complete the translations in the es.lproj/GMImagePicker.strings file for the language es (Spanish). Use the original labels in Base.lproj as a starting point.

Contributions are highly appreciated!

Font issue on iOS13

I've implemented the picker in iOS13, which works well, however it doesn't pick up the system typeface and gives me Times New Roman as a substitute. I tried using the PickerFontName option to change the typeface but this also fails if I use a system font style. Trace shows as follows:

CoreText note: Client requested name ".SFUIDisplay", it will get TimesNewRomanPSMT rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[UIFont systemFontOfSize:].

Should note that this works correctly when using non-system fonts so for the time being I have opted to use 'Helvetica' rather than the SFFont family.

Crash when a user makes a screenshot after picking an image

NullReferenceException crash in at GMImagePickerController.FinishPickingAssets happens in NuGet package 2.1.0 when a user after picking an image decides to take a screenshot of the app.

Happens on iOS 11, any real device.

{System.NullReferenceException: Object reference not set to an instance of an object at GMImagePicker.GMImagePickerController.FinishPickingAssets (System.Object sender, System.EventArgs args) [0x00028] in /Users/roy/Projects/GitHub/GMImagePicker.Xamarin/src/G…}

Detailed stack:

{System.NullReferenceException: Object reference not set to an instance of an object
  at GMImagePicker.GMImagePickerController.FinishPickingAssets (System.Object sender, System.EventArgs args) [0x00028] in /Users/roy/Projects/GitHub/GMImagePicker.Xamarin/src/GMImagePicker/GMImagePickerController.cs:369 
  at GMImagePicker.GMImagePickerController.SelectAsset (Photos.PHAsset asset) [0x000d7] in /Users/roy/Projects/GitHub/GMImagePicker.Xamarin/src/GMImagePicker/GMImagePickerController.cs:331 
  at GMImagePicker.GMGridViewController+GMGridViewCollectionViewSource.ItemSelected (UIKit.UICollectionView collectionView, Foundation.NSIndexPath indexPath) [0x0001c] in /Users/roy/Projects/GitHub/GMImagePicker.Xamarin/src/GMImagePicker/GMGridViewController.cs:549 
  at GMImagePicker.GMGridViewController+<>c__DisplayClass28_2.<PhotoLibraryDidChange>b__1 () [0x00102] in /Users/roy/Projects/GitHub/GMImagePicker.Xamarin/src/GMImagePicker/GMGridViewController.cs:383 
  at ObjCRuntime.Trampolines+SDAction.Invoke (System.IntPtr block) [0x00016] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.10.1.178/src/Xamarin.iOS/ObjCRuntime/Trampolines.g.cs:12074 
  at (wrapper native-to-managed) ObjCRuntime.Trampolines+SDAction.Invoke(intptr)}

image

EXIF data missing in iOS13.2

After importing photos EXIF data is missing from the photos. This is one of the important requirement of the app. Could you please advice?

Memory Issue

When bouncing around and selecting photos the app will crash. Im confident this is a memory issue with the picker. There are two instances in which our app is crashing due to this. If anyone has this problem or can look into fixing it that would be great.

Case 1:

  1. SELECT FROM GALLERY OPTION
    4.Tap on Camera Roll folder
  2. Tap on some photos to select then tap on them again to unselect
  3. Tap on back icon at top left of screen to go back Gallery
  4. Repeat from steps 4 to 6 for 1 min

Expected result: Should not crash app
Actual result: Crash app

Case 2:

  1. Tap on SELECT FROM GALLERY
  2. Tap on Camera Roll
  3. Tap on back icon at top left of screen to go back Gallery
  4. Repeat steps 4 and 5 for 1 min

Expected result: Should not crash app
Actual result: Crash app

Review and update translations for ru - Russian

Up for grabs: please review and update/complete the translations in the ru.lproj/GMImagePicker.strings file for the language ru (Russian). Use the original labels in Base.lproj as a starting point.

Contributions are highly appreciated!

Review and update translations for no - Norwegian

Up for grabs: please review and update/complete the translations in the no.lproj/GMImagePicker.strings file for the language no (Norwegian). Use the original labels in Base.lproj as a starting point.

Contributions are highly appreciated!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.