em cus
Browse files
__pycache__/custom_logger.cpython-313.pyc
CHANGED
|
Binary files a/__pycache__/custom_logger.cpython-313.pyc and b/__pycache__/custom_logger.cpython-313.pyc differ
|
|
|
image/javascript/image.js
CHANGED
|
@@ -298,8 +298,8 @@ async function secret_sauce(file, settings) {
|
|
| 298 |
const formData = new FormData();
|
| 299 |
formData.append('id', file.id);
|
| 300 |
for (let key of Object.keys(settings)) {
|
| 301 |
-
if (settings[key]) {
|
| 302 |
-
formData.append(
|
| 303 |
}
|
| 304 |
}
|
| 305 |
|
|
|
|
| 298 |
const formData = new FormData();
|
| 299 |
formData.append('id', file.id);
|
| 300 |
for (let key of Object.keys(settings)) {
|
| 301 |
+
if (settings[key] !== null && settings[key] !== undefined) {
|
| 302 |
+
formData.append(key, settings[key]);
|
| 303 |
}
|
| 304 |
}
|
| 305 |
|
test_convert_options.py
DELETED
|
@@ -1,41 +0,0 @@
|
|
| 1 |
-
import requests
|
| 2 |
-
import os
|
| 3 |
-
|
| 4 |
-
url = "http://localhost:8000/image/convert"
|
| 5 |
-
input_dir = "image/input"
|
| 6 |
-
file_path = os.path.join(input_dir, "test_quality.jpg")
|
| 7 |
-
output_dir = "image/output"
|
| 8 |
-
|
| 9 |
-
# Ensure directories exist
|
| 10 |
-
os.makedirs(input_dir, exist_ok=True)
|
| 11 |
-
os.makedirs(output_dir, exist_ok=True)
|
| 12 |
-
|
| 13 |
-
# Create test image
|
| 14 |
-
from PIL import Image
|
| 15 |
-
Image.new('RGB', (100, 100), color='red').save(file_path)
|
| 16 |
-
|
| 17 |
-
# Test case 1: Quality 50, Scale 0.5
|
| 18 |
-
data = {
|
| 19 |
-
"id": "test_quality.jpg",
|
| 20 |
-
"to_format": "jpg",
|
| 21 |
-
"quality": 50,
|
| 22 |
-
"scale": 0.5
|
| 23 |
-
}
|
| 24 |
-
|
| 25 |
-
try:
|
| 26 |
-
response = requests.post(url, data=data)
|
| 27 |
-
if response.status_code == 200:
|
| 28 |
-
result = response.json()
|
| 29 |
-
print(f"Success: {result}")
|
| 30 |
-
|
| 31 |
-
# Verify output file
|
| 32 |
-
output_file = os.path.join(output_dir, result['new_filename'])
|
| 33 |
-
if os.path.exists(output_file):
|
| 34 |
-
print(f"Output file created: {output_file}")
|
| 35 |
-
print(f"Output file size: {os.path.getsize(output_file)} bytes")
|
| 36 |
-
else:
|
| 37 |
-
print("Error: Output file not found")
|
| 38 |
-
else:
|
| 39 |
-
print(f"Failed: {response.status_code} - {response.text}")
|
| 40 |
-
except Exception as e:
|
| 41 |
-
print(f"Error: {e}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|