Skip to content
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

[How to use] how to correctly set "image size constraint" in filter option #1069

Open
Hyffer opened this issue Jan 6, 2024 · 1 comment
Open

Comments

@Hyffer
Copy link

Hyffer commented Jan 6, 2024

Platforms

dart, Android

Description

I am on version 2.7.2, and now deal with some pictures with 0 width * 0 height. (I don't know why it is recognized as 0w*0h, but It is a picture, which shows in my phone's native gallery app)

I have noticed there is a filterOption param in method getAssetPathList and there is SizeConstraint in imageOption, of which the default value is:

  const SizeConstraint({
    this.minWidth = 0,
    this.maxWidth = 100000,
    this.minHeight = 0,
    this.maxHeight = 100000,
    this.ignoreSize = false,
  });

On my android phone(android 10, EMUI 11.0.0), even the minWidth and minHeight set to 0, those 0 width and 0 height pictures still get filtered. Only when I set ignoreSize to true will they appear. But on an android 10 emulater, with the default filter option, those pictures will show up correctly.

This is weird why the behavior is different. Which doesn't make sense but it is the case. Maybe just an unexpected behavior of this particular android version of my phone and sadly I cannot even reproduce it on emulator.

So, to make things works, setting ignoreSize might be the only workaround for me. The question is what actually does ignoreSize do? Is it just bypass size check? will it causes more trouble if I set it to true?

My code

just calling PhotoManager.getAssetPathList to get all image folders

Try do it

No response

@lxhlzyh
Copy link

lxhlzyh commented Sep 23, 2024

Images with width and height 0 are not included.See

private fun sizeWhere(requestType: Int?, option: CommonFilterOption): String {

I think sizeWhre is redundant, because the image size limit is filtered in getCondFromType.

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

No branches or pull requests

2 participants