Coder Social home page Coder Social logo

Comments (12)

iamgbsmith avatar iamgbsmith commented on June 30, 2024

Thanks for the great library. Is it possible to add a feature to allow the sort order for album images (either ascending or descending) when pre-fetching images in albums using the previewAssets property?

from react-native-photos-framework.

olofd avatar olofd commented on June 30, 2024

@iamgbsmith I actually think you already can do that. Have you tried adding a assetFetchOptions to your getAlbums query?

Search for this text : Fetch options used when loading assets from album returned. You can choose to pass these fetchOptions here to affect previewAssetsin the README.md and you'll find docs about it.

Let me know if there is something here that does not work, or if there is anything else needed regarding this. Or if you need help applying it.

Haven't tried it, but his should work:

                RNPhotosFramework.getAlbums({
                    assetFetchOptions: {
                        sortDescriptors: [
                            {
                                key: 'creationDate',
                                ascending: true
                            }
                        ]
                    }
                }).then..

from react-native-photos-framework.

DylanVann avatar DylanVann commented on June 30, 2024

I have a somewhat "interesting" use case. I'm making a photo picker where photos are grouped by days and the user needs to be able to select all photos in a day. So ideally I'd like to be able to query by day / between a start and end time. Most of the time if the user has a reasonable amount of photos per day this isn't an issue because I'd already have loaded them when the user clicks select all. Sort of an edge case.

from react-native-photos-framework.

justinsherwood avatar justinsherwood commented on June 30, 2024

Is it possible to load certain albums on the device if they exist like Instagram or Snapchat? If not, I think it would be useful to select these albums if they exist on the users device.

from react-native-photos-framework.

olofd avatar olofd commented on June 30, 2024

@justinsherwood I do not really follow what you mean? Expand please.

from react-native-photos-framework.

justinsherwood avatar justinsherwood commented on June 30, 2024

I'm currently using the getAlbumsMany method to return a list of albums by passing an array containing smartAlbumUserLibrary, smartAlbumFavorites, smartAlbumSelfPortraits, etc. I think it would be nice to also query custom albums created by the user that are not "system specific" albums if they exist. An example of this would be including the Instagram or Snapchat albums on a users device.

For example, including specific "My Albums" albums

image1

from react-native-photos-framework.

olofd avatar olofd commented on June 30, 2024

@justinsherwood They should already be included if you just:

                RNPhotosFramework.getAlbums().then...

Does that not work?

You could also use:

        return RNPhotosFramework.getAlbumsCommon({
            trackInsertsAndDeletes: true,
            trackChanges: true,
            assetCount: 'exact',
            includeMetaData: false,
            previewAssets: 2
        }, true).then((queryResult) => {
            return queryResult.instagramAppAlbumSort();
        });

If you like the albums in the exact order the instagram app shows them.
You can also use: queryResult.photoAppAlbumSort() if you want the same order as apple's photos app.

You should not have to use getAlbumsMany. And by passing that array with smartAlbum-values you´re actively excluding user created albums. That's why you do not get them in your result.

from react-native-photos-framework.

justinsherwood avatar justinsherwood commented on June 30, 2024

I understand that, but the issue is deciding which specific system albums to include, as well as specific user albums. I do not want to include all user created albums, only specific ones like albums titled Instagram or Snapchat. Basically, I want to be able to choose which user albums to include in my query if they exist in addition to the specific smartAlbums I am interested in displaying.

For example, when I run the code you mentioned I receive 100's of user created albums that I am not interested in displaying to users. (albums with specific dates, etc)

The mean reason I think this feature would be useful is to limit the number of displayed custom user created albums to increase performance and to avoid loading 100's of random albums.

from react-native-photos-framework.

zweck avatar zweck commented on June 30, 2024

I'm struggling at the moment to find a simple / elegant way of sharing a photo fetched with RNPhotosFramework. At the moment I'm trying to write an ObjC lib to return me a base64 version of the image from the photos:// uri; but if that feature was in this library it would be lovely.

from react-native-photos-framework.

justinsherwood avatar justinsherwood commented on June 30, 2024

Does this library work with Android as well? I tried including it in an android project, but get the error: Could not find react-native-photos-framework's native module.

from react-native-photos-framework.

arberkryeziu avatar arberkryeziu commented on June 30, 2024

Thank you for the great library!

  1. One interesting case would be to return a boolean, if the asset is currently stored on the device or in the cloud! The native Photos app let users know which assets are stored in the cloud by showing a cloud icon mark over the asset.

  2. Another issue that I have (somewhat related to 1. ) is that, when assets are returned e.g. by calling getAssets(), all the assets which are not stored on the device, are being downloaded from the cloud. It would be nice to have some thumbnails for each asset, and a triggering function for the asset to be downloaded from the cloud, as soon as the user clicks on that specific asset.

from react-native-photos-framework.

monolithed avatar monolithed commented on June 30, 2024

+1 for moving a photo to another album

from react-native-photos-framework.

Related Issues (20)

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.