10000 [Bug report] AssetPathEntity not returning all assets · Issue #1270 · fluttercandies/flutter_photo_manager · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[Bug report] AssetPathEntity not returning all assets #1270

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
shenlong-tanwen opened this issue Mar 3, 2025 · 3 comments
Closed

[Bug report] AssetPathEntity not returning all assets #1270

shenlong-tanwen opened this issue Mar 3, 2025 · 3 comments
Labels

Comments

@shenlong-tanwen
Copy link
Contributor

Version

3.6.4

Platforms

Android

Device Model

Motorola Edge 20 Pro (Android 13)

flutter info

[✓] Flutter (Channel stable, 3.29.0, on macOS 15.3.1 24D70 darwin-arm64, locale en-IN) [2.1s]
    • Flutter version 3.29.0 on channel stable at /Users/xxx/Flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 35c388afb5 (3 weeks ago), 2025-02-10 12:48:41 -0800
    • Engine revision f73bfc4522
    • Dart version 3.7.0
    • DevTools version 2.42.2

[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0) [2.5s]
    • Android SDK at /Users/xxx/Library/Android/sdk
    • Platform android-35, build-tools 35.0.0
    • ANDROID_HOME = /Users/xxx/Library/Android/sdk
    • Java binary at: /Users/xxx/Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
      This is the JDK bundled with the latest Android Studio installation on this machine.
      To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
    • Java version OpenJDK Runtime Environment (build 21.0.5+-13047016-b750.29)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 16.2) [2.6s]
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 16C5032a
    • CocoaPods version 1.16.2

[✓] Android Studio (version 2024.2) [14ms]
    • Android Studio at /Users/xxx/Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 21.0.5+-13047016-b750.29)

[✓] VS Code (version 1.97.2) [12ms]
    • VS Code at /Users/xxx/Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.104.0

[✓] Connected device (4 available) [6.4s]
    • sdk gphone64 arm64 (mobile)     • emulator-5554             • android-arm64 • Android 12 (API 32) (emulator)

[✓] Network resources [3.2s]
    • All expected network resources are available.

• No issues found!

How to reproduce?

The users of our app reported an issue where not all assets are being listed in the app for every albums. To rule out the issue with the app, we shared a debug app of the example app from the library for testing with the user. The default Gallery list screen in the example has the same issue as our app, where not all assets from the album are being listed. However, the users confirmed that using the Custom SQL filter returns all assets properly.

We did not change anything with respect to how we fetch the AssetPathEntity or the Assets recently, and the issue seems to occur only for a small set of users. So far, only 3 users have reported the issue and each of them are on different android versions, 11, 13 and 14.

Attaching the screenshots from the example app as shared by the user

Custom SQL Gallery List Filters Used in Gallery

The current version of the library used in our app is - 3.6.1, however, the example was built using 3.6.4, which is still the latest version at the time of writing this.

I understand the difference in results as the classical filter has a set of default values for filtering and the custom filter does not. But why is the classical filter not returning all the assets still with the default values?

Logs

Example code (optional)

Contact

No response

@fluttercandies-dev
Copy link

AI Summary: The AssetPathEntity is not returning all assets in some albums on Android devices. A custom SQL filter returns all assets, but the default gallery list does not.

@CaiJingLong
Copy link
Member

My suggestion is that if you really need to view all the data, using custom SQL is a better choice, and I actually recommend using custom SQL. Otherwise I wouldn't have to rewrite custom SQL support :)

By default, CommonFilter will filter out assets whose width and height in the metadata (MediaStore) are NULL. This was originally because some images were corrupted when they were stored.
Subsequently, this situation was retained in order not to disrupt user behavior, even if we later find that there will be normal image storage, the width and height values ​​will not be saved. The official Android documentation states that the width and height values ​​should be written by the system when writing data, but different device manufacturers may have missed this step.

@CaiJingLong
Copy link
Member

It is an implementation deviation from the documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants
0