fluttercandies / flutter_image_editor

Flutter plugin, support android/ios.Support crop, flip, rotate, color martix, mix image, add text. merge multi images.
Apache License 2.0
407 stars 124 forks source link

[Bug] PlatformException on WebP images #106

Open mitrakov opened 1 year ago

mitrakov commented 1 year ago

Version

1.3.0

Platforms

macOS

Device Model

MacOS 10.15.7

flutter info

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.7.1, on Mac OS X 10.15.7 19H2026 darwin-x64, locale en-GB)
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.
[!] Xcode - develop for iOS and macOS (Xcode 12.4)
    ✗ Flutter requires Xcode 13 or higher.
      Download the latest version or update via the Mac App Store.
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.3)
[✓] IntelliJ IDEA Community Edition (version 2022.3.1)
[✓] VS Code (version 1.74.2)
[✓] Connected device (2 available)
[✓] HTTP Host Availability

! Doctor found issues in 2 categories.

How to reproduce?

Open any webp image and run:

final Uint8List image = ...; // any webp image
ImageEditor.editImage(image: image, imageEditorOption: option);

Logs

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(decode image error, null, null, null)
#0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:653:7)
#1      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:315:18)
<asynchronous suspension>
#2      NativeChannel.memoryToMemory (package:image_editor_platform_interface/src/channel.dart:50:20)
<asynchronous suspension>
#3      ImageEditorCommon.editImage (package:image_editor_common/image_editor_common.dart:32:13)
<asynchronous suspension>

Example code (optional)

No response

Contact

mitrakov-artem@yandex.ru

CaiJingLong commented 1 year ago

The ios/macOS decoder of native not support webp. You must convert webp to png or jpeg first.

mitrakov commented 1 year ago

You must convert webp to png or jpeg first.

Is it possible with this library?

MayurSankhla commented 6 months ago

need solution of this issue. help