flutter_image_editor icon indicating copy to clipboard operation
flutter_image_editor copied to clipboard

[Bug] PlatformException on WebP images

Open mitrakov opened this issue 2 years ago • 3 comments

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

[email protected]

mitrakov avatar Feb 13 '23 22:02 mitrakov

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

CaiJingLong avatar Feb 14 '23 02:02 CaiJingLong

You must convert webp to png or jpeg first.

Is it possible with this library?

mitrakov avatar Feb 14 '23 19:02 mitrakov

need solution of this issue. help

MayurSankhla avatar Feb 19 '24 12:02 MayurSankhla