Skip to content

refactor: Enhance gallery selection, add MIME type validation, and re…#98

Merged
ismoy merged 1 commit into
mainfrom
develop
Mar 9, 2026
Merged

refactor: Enhance gallery selection, add MIME type validation, and re…#98
ismoy merged 1 commit into
mainfrom
develop

Conversation

@ismoy
Copy link
Copy Markdown
Owner

@ismoy ismoy commented Mar 9, 2026

…fine project structure

This commit introduces post-selection MIME type validation for Android and iOS, improves the gallery selection logic, and performs a significant internal refactor to improve visibility modifiers and documentation.

Breaking Changes:

  • Removed directCameraLaunch, dialogTitle, takePhotoText, selectFromGalleryText, cancelText, and customPickerDialog from ImagePickerConfig. The library now leans towards native platform behaviors or more granular configuration.
  • Removed onPhotosSelected from ImagePickerConfig; use GalleryPickerLauncher for multiple selection flows.
  • GalleryConfig is no longer a property of CameraCaptureConfig.

New Features:

  • Added mimeTypeMismatchMessage to GalleryPickerLauncher and ImagePickerConfig to provide custom error messages when selected files don't match allowed types.
  • Added localized string mime_type_mismatch_error for English, Spanish, French, and Korean.
  • Improved iOS PHPicker and UIImagePickerController handling to support swipe-to-dismiss detection via UIAdaptivePresentationControllerDelegate.
  • Added thread-safe caching for PhotoResult extensions on iOS using NSLock.

Fixes & Improvements:

  • Android: Implemented post-selection URI filtering to ensure MIME types match allowed values, as the native picker doesn't always respect subtype filters (e.g., image/webp).
  • iOS: Added logic to verify the actual file extension/MIME type of selected items in ImageProcessingQueue and GalleryDelegate.
  • Refactor: Changed dozens of internal classes and utilities to internal visibility to clean up the public API surface.
  • JVM: Updated ImagePickerLauncher to limit selection to a single image by default to align with the onPhotoCaptured contract.
  • Documentation: Added comprehensive KDoc comments to public configuration classes like ImagePickerConfig, CameraCaptureConfig, and GalleryPickerLauncher.

Other Changes:

  • Incremented project version to 1.0.33.
  • Updated Detekt configuration to be less restrictive on documentation end-of-sentence formats.
  • Removed unused showImagePickerDialog and related logic on iOS.

…fine project structure

This commit introduces post-selection MIME type validation for Android and iOS, improves the gallery selection logic, and performs a significant internal refactor to improve visibility modifiers and documentation.

**Breaking Changes:**
- Removed `directCameraLaunch`, `dialogTitle`, `takePhotoText`, `selectFromGalleryText`, `cancelText`, and `customPickerDialog` from `ImagePickerConfig`. The library now leans towards native platform behaviors or more granular configuration.
- Removed `onPhotosSelected` from `ImagePickerConfig`; use `GalleryPickerLauncher` for multiple selection flows.
- `GalleryConfig` is no longer a property of `CameraCaptureConfig`.

**New Features:**
- Added `mimeTypeMismatchMessage` to `GalleryPickerLauncher` and `ImagePickerConfig` to provide custom error messages when selected files don't match allowed types.
- Added localized string `mime_type_mismatch_error` for English, Spanish, French, and Korean.
- Improved iOS `PHPicker` and `UIImagePickerController` handling to support swipe-to-dismiss detection via `UIAdaptivePresentationControllerDelegate`.
- Added thread-safe caching for `PhotoResult` extensions on iOS using `NSLock`.

**Fixes & Improvements:**
- **Android:** Implemented post-selection URI filtering to ensure MIME types match allowed values, as the native picker doesn't always respect subtype filters (e.g., `image/webp`).
- **iOS:** Added logic to verify the actual file extension/MIME type of selected items in `ImageProcessingQueue` and `GalleryDelegate`.
- **Refactor:** Changed dozens of internal classes and utilities to `internal` visibility to clean up the public API surface.
- **JVM:** Updated `ImagePickerLauncher` to limit selection to a single image by default to align with the `onPhotoCaptured` contract.
- **Documentation:** Added comprehensive KDoc comments to public configuration classes like `ImagePickerConfig`, `CameraCaptureConfig`, and `GalleryPickerLauncher`.

**Other Changes:**
- Incremented project version to `1.0.33`.
- Updated Detekt configuration to be less restrictive on documentation end-of-sentence formats.
- Removed unused `showImagePickerDialog` and related logic on iOS.
@ismoy ismoy merged commit 3871eb5 into main Mar 9, 2026
7 checks passed
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

Successfully merging this pull request may close these issues.

1 participant