ميزه: إضافة ميزات جديدة لتحرير PDF، OCR، وإزالة الخلفية مع تفعيل خيارات في ملف البيئة
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user