Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -62,7 +62,7 @@ if uploaded_files:
|
|
| 62 |
|
| 63 |
col_cropper, col_preview = st.columns([1, 1])
|
| 64 |
|
| 65 |
-
# ---
|
| 66 |
with col_cropper:
|
| 67 |
st.markdown("### ✂️ Select Crop Area (Original Image):")
|
| 68 |
crop_output = st_cropper(
|
|
@@ -70,8 +70,7 @@ if uploaded_files:
|
|
| 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}"):
|
|
@@ -105,7 +104,6 @@ if uploaded_files:
|
|
| 105 |
st.info("✂️ Please crop an area first to enable editing.")
|
| 106 |
|
| 107 |
processed_images.append(st.session_state.get(f"edited_{idx}", original_img))
|
| 108 |
-
|
| 109 |
st.markdown("---")
|
| 110 |
|
| 111 |
# --- EXPORT OPTIONS ---
|
|
|
|
| 62 |
|
| 63 |
col_cropper, col_preview = st.columns([1, 1])
|
| 64 |
|
| 65 |
+
# --- Hugging Face-safe cropper ---
|
| 66 |
with col_cropper:
|
| 67 |
st.markdown("### ✂️ Select Crop Area (Original Image):")
|
| 68 |
crop_output = st_cropper(
|
|
|
|
| 70 |
realtime_update=False,
|
| 71 |
box_color='#FF9900',
|
| 72 |
aspect_ratio=None,
|
| 73 |
+
return_type="image"
|
|
|
|
| 74 |
)
|
| 75 |
|
| 76 |
if st.button("✂️ Crop Now", key=f"crop_{idx}"):
|
|
|
|
| 104 |
st.info("✂️ Please crop an area first to enable editing.")
|
| 105 |
|
| 106 |
processed_images.append(st.session_state.get(f"edited_{idx}", original_img))
|
|
|
|
| 107 |
st.markdown("---")
|
| 108 |
|
| 109 |
# --- EXPORT OPTIONS ---
|