Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
de11379
- Solved the issue of "Auto-Zoom Feature Not Working When Cropping As…
jwalantMehtaMindInventory Apr 24, 2025
6093e53
- Solved issue coming when having both auto and manual zoom together.
jwalantMehtaMindInventory Apr 28, 2025
a92101b
- Manual zooming done along with the exif data handling.
jwalant-mehta Jul 2, 2025
3a5c7ab
- Handled the image flipping along with the zoom.
jwalant-mehta Aug 6, 2025
32a8003
- Added some log statements and cleaned the unwanted code.
jwalant-mehta Aug 11, 2025
5bf5ef1
- Adding the "ZoomType" parameter in the CropImageOptions.kt
jwalant-mehta Aug 19, 2025
604c7c7
Merge pull request #136 from Mindinventory/develop
sanjay-mi Apr 27, 2026
5c5e316
Fixed crop output to preserve manual zoom, pan, and crop window position
BhavinVala18 May 14, 2026
babdebd
Fixed crashing issue in VideoPreviewActivity.
BhavinVala18 May 28, 2026
22194c4
Merge remote-tracking branch 'origin/master' into hotfix/auto_manual_…
BhavinVala18 May 28, 2026
b04a785
Took merge from master branch.
BhavinVala18 May 28, 2026
e908399
- Removed commented code and logs.
BhavinVala18 May 28, 2026
3329b49
Rename .java to .kt
BhavinVala18 May 28, 2026
5f94eff
- Converted EglCore file in kotlin.
BhavinVala18 May 28, 2026
d9e037c
- Removed commented code from crop_image_view.xml.
BhavinVala18 May 28, 2026
a9b1ceb
- Removed zoom type.
BhavinVala18 May 28, 2026
c0b820f
- Updated README.md file.
BhavinVala18 May 28, 2026
2ea5cb8
- Updated versionCode and versionName.
BhavinVala18 May 28, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ This update introduces modern **edge-to-edge UI support** and removes deprecated

We have implemented full edge-to-edge UI across all screens.

### 2. ✅ Auto & Manual Zoom Support

- Improved pinch-to-zoom and drag gesture handling.
- Preserves the current zoom and pan position during cropping.
- Prevents zoom reset and image snap-back issues.
- Ensures cropped output matches the visible preview area.

#### 🔹 Key Improvements:
- App content now draws behind the **status bar** and **navigation bar**
- Improved immersive UI experience
Expand Down Expand Up @@ -119,7 +126,8 @@ Using these APIs may lead to:
.setSupportedFileTypes("mp4", "mkv", "webm", "avi", "flv", "3gp") // Filter by limited media format (Optional)
.setMinFileSize(100) // Restrict by minimum file size
.setMaxFileSize(1024) // Restrict by maximum file size
.disableCrop() // to remove crop from the single image selection (crop is enabled by default for single image)
// **Note:** Crop-related methods such as `enableFlip()`, `enableRotate()`, `setAspectRatio()`, and `setCropType()`, will not work when `disableCrop()` is enabled.
.disableCrop() // to remove crop from the image selection
/*
* Configuration for UI
*/
Expand Down
28 changes: 26 additions & 2 deletions app/src/main/java/com/lassi/app/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ package com.lassi.app
import android.app.Activity
import android.content.ContentResolver
import android.content.Intent
import android.media.ExifInterface
import android.net.Uri
import android.os.Build
import android.os.Bundle
import android.os.Environment
import android.provider.Settings
import android.util.Log
import android.view.View
import android.webkit.MimeTypeMap
import androidx.activity.result.contract.ActivityResultContracts
Expand All @@ -28,6 +30,7 @@ import com.lassi.presentation.builder.Lassi
import com.lassi.presentation.common.decoration.GridSpacingItemDecoration
import com.lassi.presentation.cropper.CropImageView
import java.io.File
import java.io.IOException
import java.util.Locale

class MainActivity : AppCompatActivity(), View.OnClickListener {
Expand Down Expand Up @@ -100,9 +103,9 @@ class MainActivity : AppCompatActivity(), View.OnClickListener {
.setProgressBarColor(R.color.colorAccent)
.setGalleryBackgroundColor(R.color.colorGrey)
.setCropType(CropImageView.CropShape.OVAL).setCropAspectRatio(1, 1)
.setCompressionRatio(10).setMinFileSize(0).setMaxFileSize(Int.MAX_VALUE.toLong())
.setCompressionRatio(10).setMinFileSize(0)
.setMaxFileSize(Int.MAX_VALUE.toLong())
.enableActualCircleCrop()
.disableCrop()
.setSupportedFileTypes("jpg", "jpeg", "png", "webp", "gif").enableFlip()
.enableRotate().build()
receiveData.launch(intent)
Expand Down Expand Up @@ -296,6 +299,27 @@ class MainActivity : AppCompatActivity(), View.OnClickListener {
it.data?.getParcelableArrayListExtra(KeyUtils.SELECTED_MEDIA)
}

selectedMedia?.forEachIndexed { index, miMedia ->
miMedia.path?.let { path ->
try {
val exif = ExifInterface(path)
val orientation = exif.getAttributeInt(
ExifInterface.TAG_ORIENTATION,
ExifInterface.ORIENTATION_NORMAL
)
exif.javaClass.declaredFields
.filter { it.name.startsWith("TAG_") }
.forEach { field ->
field.isAccessible = true
val tag = field.get(null) as? String ?: return@forEach
val value = exif.getAttribute(tag)
}
} catch (e: IOException) {
Log.e("EXIF_CHECK", "Failed to read EXIF for $path", e)
}
}
}

if (!selectedMedia.isNullOrEmpty()) {
binding.ivEmpty.isVisible = selectedMedia.isEmpty()
selectedMediaAdapter.setList(selectedMedia)
Expand Down
4 changes: 2 additions & 2 deletions lassi/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ android {
defaultConfig {
minSdk 21
targetSdk 36
versionCode 32
versionName "1.5.0"
versionCode 33
versionName "1.5.1"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
multiDexEnabled true
Expand Down
2 changes: 1 addition & 1 deletion lassi/src/main/java/com/lassi/domain/media/LassiConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ data class LassiConfig(
var alertDialogNegativeButtonColor: Int = Color.BLACK,
var alertDialogPositiveButtonColor: Int = Color.BLACK,
var customLimitExceedingErrorMessage: String = ERROR_EXCEEDING_MSG,
var isMultiPicker: Boolean = false
var isMultiPicker: Boolean = false,
) : Parcelable {
companion object {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,10 @@ class CameraFragment : LassiBaseViewModelFragment<CameraViewModel, FragmentCamer
viewModel.cropImageLiveData.observe(this, SafeObserver { uri ->
val config = LassiConfig.getConfig()


mediaList = arrayListOf(createMiMedia(uri.path))
croppedMediaList.addAll(config.selectedMedias + mediaList)
croppedMediaList.addAll(config.selectedMedias + mediaList)
if (config.compressionRatio > 0 && !config.isCrop) {
compressMedia(croppedMediaList)
} else { // user has selected the crop option.
Expand Down
Loading