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

Error with .HEIF Image Format in iOS Simulator #184

Open
3pensozcn opened this issue Jan 24, 2025 · 1 comment
Open

Error with .HEIF Image Format in iOS Simulator #184

3pensozcn opened this issue Jan 24, 2025 · 1 comment
Labels
bug Something isn't working need fix Issues that @chooyan-eng need to do something

Comments

@3pensozcn
Copy link

When i try to select an in image in .heif format from the gallery in ios simulator and show it in the crop package, i get the following error.

package:crop_your_image/src/logic/parser/image_image_parser.dart': Failed assertion: line 20 pos 10: 'tempImage != null': is not true.

code sample:

void onTapImage(AssetEntity imageData) async {
File? file = await imageData.file;
if (file != null) {
int sizeInBytes = (await imageData.originBytes)!.length;
double sizeInMB = sizeInBytes / (1024 * 1024);

    if (imageData.type == AssetType.image &&
        sizeInMB <= AppConstants.maxImageSizeMB) {
      selectedImages = await imageData.originBytes;
      nextPage();
    } else {
      context?.showImageErrorSnackbar(
        context!.t!.maxImageSizeMessage,
      );
      return;
    }
  }

notifyListeners();

}

when i try to use selectedImages inside the crop widget i got error above. to select the image i am using photo_manager package. when i use the imageData.thumnailData it show without problem.

flutter doctor results:

[✓] Flutter (Channel stable, 3.27.1, on macOS 15.1.1 24B91 darwin-arm64, locale en-TR)
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 16.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.1)
[✓] VS Code (version 1.95.3)
[✓] Connected device (4 available)
[✓] Network resources

@chooyan-eng
Copy link
Owner

@3pensozcn Thank you for the issue! I'll check.

@chooyan-eng chooyan-eng added bug Something isn't working need fix Issues that @chooyan-eng need to do something labels Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working need fix Issues that @chooyan-eng need to do something
Projects
None yet
Development

No branches or pull requests

2 participants