image_picker_master 0.1.3
image_picker_master: ^0.1.3 copied to clipboard
A comprehensive Flutter plugin for picking images, videos, audio files, documents, and any file type, multiple selection, and file categorization.
0.1.3 #
-
Android (Windows cross-drive fix — attempt 2): The previous fix (
compilerOptions { incremental = false }inside aKotlinCompiletask) had no effect because the Kotlin daemon reads the incremental flag from Gradle properties, not from task-level compiler options. Addedandroid/gradle.propertieswithkotlin.incremental=false. This is the only reliable way to disable Kotlin incremental compilation at the module level. The task-level block has been removed. -
Android (Windows fix): Disabled Kotlin incremental compilation in the plugin's
build.gradle.kts. Kotlin's incremental compiler usesFile.relativeTo()to store source paths in its cache. On Windows, when the Pub Cache (C:\Users\...\AppData\Local\Pub\Cache\) and the Flutter project are on different drives (e.g.G:\),relativeTo()throwsIllegalArgumentException: this and base files have different roots, crashing the build. Settingincremental = falseintasks.withType<KotlinCompile>eliminates therelativeTo()call entirely. This setting is scoped to this library only and has no effect on the host app's own incremental compilation. -
Windows (critical fix):
ResizeImageForCropperandCropImageNativewere callingshared_result->Success/Error()directly from a backgroundstd::thread, which violates Flutter Windows SDK threading requirements and caused the app to crash/close when cropping.- Added a message-only
HWND_MESSAGEdispatch window created at plugin init. - Added
PostToMainThread(fn)helper that queues callbacks underpending_mutex_and wakes the platform thread viaPostMessageW(dispatch_hwnd_, WM_APP+1, 0, 0). - Both background methods now call
PostToMainThreadinstead of calling the result directly. - Destructor destroys the dispatch window and drains pending callbacks before cleanup.
- Added a message-only
-
Windows (data race fix): All accesses to
temporary_files_(push inCreateTempFilePath, push in bg threads, iterate+clear inCleanupTempFiles) are now protected bytemp_files_mutex_(std::mutex). -
Windows (phantom path fix):
ResizeImageForCropperpreviously calledCreateTempFilePath("jpg")to get a UUID string but wrote to a different path, leaving a non-existent entry intemporary_files_. Now usesCoCreateGuiddirectly without registering a phantom path. -
All platforms: Added
cropImageNative()— full decode → rotate → crop → encode pipeline running on a native background thread/queue. Replaces the pure-Dartcompute()isolate (~3,700 ms) with ~115 ms native execution on a 2 MB JPEG.- Supports output formats:
"jpeg"(default),"png","webp_lossy","webp_lossless". - Android:
BitmapFactory.inSampleSize+Bitmap.compress(WEBP_LOSSY/LOSSLESS/JPEG/PNG). WEBP_LOSSY/LOSSLESS falls back to legacyWEBPon API < 30. - iOS:
CGImageSourceCreateThumbnailAtIndex+UIImage.jpegData/pngData. WebP falls back to JPEG (no native iOS WebP encoder). - macOS:
CGImageSourceCreateThumbnailAtIndex+NSBitmapImageRepJPEG/PNG. WebP falls back to JPEG. - Windows: GDI+
GetThumbnailImage+Bitmap.SaveJPEG/PNG onstd::thread. WebP falls back to JPEG. - Linux:
gdk_pixbuf_scale_simple+gdk_pixbuf_saveJPEG/PNG. WebP falls back to JPEG. - Web: Canvas 2D rotation → crop →
toDataURLwithimage/jpeg,image/png, orimage/webp.
- Supports output formats:
-
iOS: Added
resizeImageForCropper()— usesCGImageSourceCreateThumbnailAtIndex(ImageIO framework) for native thumbnail decode with EXIF rotation support. Completes in ~50 ms vs ~10 s in pure Dart. -
macOS: Added
resizeImageForCropper()— same ImageIO path as iOS; encodes viaNSBitmapImageRepJPEG compression. -
Windows: Added
resizeImageForCropper()— uses GDI+Bitmap::GetThumbnailImageon a backgroundstd::thread. Output written to%TEMP%\cropper_preview\. -
Linux: Added
resizeImageForCropper()— usesgdk_pixbuf_scale_simplewithGDK_INTERP_BILINEAR(native C). Output written to/tmp/cropper_preview/. -
Web: Added
resizeImageForCropper()— loads the blob URL into an<img>, draws it at target size viaCanvasRenderingContext2D.drawImage(browser native compositor), returns a new JPEG blob URL. -
Web stub: Added matching
resizeImageForCropper()override. -
Android: Added
resizeImageForCropper()method — usesBitmapFactory.inSampleSizefor native resize, reducing a ~10 s pure-Dart decode on a 2 MB JPEG to ~50–150 ms.- Reads image dimensions first with
inJustDecodeBounds(zero pixel decode). - Calculates the optimal
inSampleSizeto fit withinmaxSizein one pass. - Fine-tunes with
createScaledBitmapif needed. - Uses
RGB_565config to halve memory usage during decode. - Writes result to
caches/cropper_preview/and tracks it forclearTemporaryFiles(). - Falls back to the original path on any error so the cropper never crashes.
- Reads image dimensions first with
-
Dart: Added
resizeImageForCropper({required String path, int maxSize = 1024})toImagePickerMasterPlatform,MethodChannelImagePickerMaster, andImagePickerMaster. -
Android: Added
res/xml/file_paths.xmlresource required byFileProvider— fixesAAPT: error: resource xml/file_paths not foundbuild failure in host apps. -
Android: Downgraded AGP from
9.0.1→8.7.3and Gradle wrapper from9.1.0→8.11.1to resolve Kotlin daemon incremental cache corruption (IllegalStateException: Storage already registered). -
Android: Pinned Kotlin Gradle Plugin to
2.1.21(replaced non-existent2.3.20). -
Web: Fixed
unawaited_futureslint — addedawaittoloadCompleter.futureinside_compressJpegso exceptions are properly caught by the surroundingtry/catch. -
Example: Removed all
debugPrintcalls fromexample/lib/main.dart. -
Example: Translated camera error messages in
_getCameraErrorMessagefrom Persian to English. -
Web: Replaced
dart:htmlwithpackage:web(dart:js_interop) for full WASM compatibility. -
Web: Rewrote file picker, camera capture, and image compression using
web.*APIs — no breaking changes to the public API. -
pubspec: Bumped version to
0.0.6.
0.0.5 #
- Android: Fixed
IllegalStateException: Reply already submittedcrash when camera permission is denied. - Android: Added runtime
CAMERApermission request — users are now prompted automatically. - Android: Introduced
SingleUseResultwrapper to prevent double-reply on all method calls. - Android: Migrated to AGP 9.0 built-in Kotlin support; removed legacy
buildscriptKGP classpath. - iOS: Fixed video picking hang on iOS 14+ caused by
UTType.movievskUTTypeMovieidentifier mismatch. - iOS: Fixed
isCapturePhotoModenot resetting on camera error paths. - iOS: Fixed
compressionQualitystate bleeding between sequential calls. - iOS: Fixed iPad
UIAlertControllerpopover outside-tap leaving Dart future unresolved. - iOS: Fixed
UIDocumentPickerViewControllerreading from original URL instead of copied temp file. - iOS: Fixed
FileType.customignoringallowedExtensionson iOS < 14. - iOS: Refactored to per-call isolated state (
PendingCall) — eliminates shared-state race conditions. - iOS/macOS: Enabled
PrivacyInfo.xcprivacyin bothPackage.swiftand.podspec. - iOS: Added
script_phaseto auto-inject camera and photo library permission descriptions into host appInfo.plist. - macOS: Added
script_phaseto auto-inject camera permission descriptions and entitlements into host app. - macOS: Fixed
.podspecplatform version (10.11→10.15) to matchPackage.swift. - Linux: Added missing
find_package(PkgConfig),GDK_PIXBUF,GIOdeclarations andCXX_STANDARD 17toCMakeLists.txt. - Linux: Fixed
bytesfield sent as base64Stringinstead ofUint8List. - Linux: Added
mimeTypedetection viag_content_type_guess. - Linux: Added
clearTemporaryFilesmethod handler. - Linux: Fixed
capturePhototo open an image file picker instead of returning an unsupported error. - Tests: Fixed
ImagePickerMaster()unnamed constructor error — updated all test files to useImagePickerMaster.instance. - pubspec: Fixed
homepageURL (removed trailing.git) and addedrepositoryandissue_trackerfields.
0.0.4 #
- Fix pug for web.
- Edit README.md.
- Fix pug Android for camera.
0.0.3 #
- Add new method for picker camera.
0.0.2 #
- Fix pub point.
- Add document package.
0.0.1 #
- Initial release.