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

Issue of getting filtered image #45

Open
An19ik89 opened this issue Aug 27, 2020 · 3 comments
Open

Issue of getting filtered image #45

An19ik89 opened this issue Aug 27, 2020 · 3 comments

Comments

@An19ik89
Copy link

Can you help me with one thing i don't understand how to do that.Please i am grateful to you if you help me.
PhotoFilter _photoFilter;
Filter _filter = presetFiltersList[23];
_photoFilter = new PhotoFilter(
image: image,
filename: fileName,
filter: _filter,
fit: BoxFit.fill,
);
After doing that I need the filtered image.
Uint32List _uint32list = _photoFilter.image.data;
Uint8List byte_data= _uint32list.buffer.asUint8List(); i did that process to get the filtered image.but could not. wheni try to read the filtered image in Image.memory(byte_data);
showing that "Exception: Invalid image data"
can you help me please ?

@skkallayath
Copy link
Owner

skkallayath commented Aug 30, 2020

I hope this will help you

void applyFilterOnFile(Filter filter, String src, String dest) {
  Image image = decodeImage(File(src).readAsBytesSync());
  var pixels = image.getBytes();
  filter.apply(pixels, image.width, image.height);
  Image out = Image.fromBytes(image.width, image.height, pixels);
  new File(dest).writeAsBytesSync(encodeNamedImage(out, dest));
}

@skkallayath
Copy link
Owner

@Usamait13
Copy link

I also face this problem

TO solve this problem I simply edit library.
In library there was get path of WRONG directory
replace with
dirctory = getTempraryDirectories();
in side the library

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

No branches or pull requests

3 participants