ميزه: إضافة ميزات جديدة لتحرير PDF، OCR، وإزالة الخلفية مع تفعيل خيارات في ملف البيئة

This commit is contained in:
Your Name
2026-03-08 22:51:50 +02:00
parent d7f6228d7f
commit 0a0c069a58
16 changed files with 242 additions and 62 deletions

View File

@@ -22,8 +22,8 @@ ALLOWED_OCR_TYPES = ALLOWED_IMAGE_TYPES + ["pdf"]
def _check_feature_flag():
"""Return an error response if FEATURE_EDITOR is disabled."""
if not current_app.config.get("FEATURE_EDITOR", False):
"""Return an error response if FEATURE_OCR is disabled."""
if not current_app.config.get("FEATURE_OCR", True):
return jsonify({"error": "This feature is not enabled."}), 403
return None

View File

@@ -28,7 +28,7 @@ def remove_bg_route():
- 'file': Image file (PNG, JPG, JPEG, WebP)
Returns: JSON with task_id for polling
"""
if not current_app.config.get("FEATURE_EDITOR", False):
if not current_app.config.get("FEATURE_REMOVEBG", True):
return jsonify({"error": "This feature is not enabled."}), 403
if "file" not in request.files: