Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -62,21 +62,21 @@ if uploaded_files:
|
|
| 62 |
|
| 63 |
col_cropper, col_preview = st.columns([1, 1])
|
| 64 |
|
|
|
|
| 65 |
with col_cropper:
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
|
| 81 |
with col_preview:
|
| 82 |
st.markdown("### 🎯 Preview and Edit:")
|
|
|
|
| 62 |
|
| 63 |
col_cropper, col_preview = st.columns([1, 1])
|
| 64 |
|
| 65 |
+
# --- Final fixed cropper section ---
|
| 66 |
with col_cropper:
|
| 67 |
+
st.markdown("### ✂️ Select Crop Area (Original Image):")
|
| 68 |
+
crop_output = st_cropper(
|
| 69 |
+
st.session_state[f"cropper_{idx}"],
|
| 70 |
+
realtime_update=False,
|
| 71 |
+
box_color='#FF9900',
|
| 72 |
+
aspect_ratio=None,
|
| 73 |
+
return_type="image",
|
| 74 |
+
container_width=True # ✅ Fixed here
|
| 75 |
+
)
|
| 76 |
+
|
| 77 |
+
if st.button("✂️ Crop Now", key=f"crop_{idx}"):
|
| 78 |
+
st.session_state[f"preview_{idx}"] = crop_output
|
| 79 |
+
st.success("✅ Cropped! Now Edit Preview.")
|
|
|
|
| 80 |
|
| 81 |
with col_preview:
|
| 82 |
st.markdown("### 🎯 Preview and Edit:")
|