Esmaill1 commited on
Commit ·
e6fedb0
1
Parent(s): 9fac438
Make branding bottom offset controllable via settings.json
Browse files- config/settings.json +2 -1
- core/layout_engine.py +2 -2
config/settings.json
CHANGED
|
@@ -10,7 +10,8 @@
|
|
| 10 |
"photo_bottom_pad_cm": 0.7,
|
| 11 |
"brand_border": 50,
|
| 12 |
"section_gap": 5,
|
| 13 |
-
"photo_stroke_width":
|
|
|
|
| 14 |
},
|
| 15 |
"overlays": {
|
| 16 |
"logo_size_small": 70,
|
|
|
|
| 10 |
"photo_bottom_pad_cm": 0.7,
|
| 11 |
"brand_border": 50,
|
| 12 |
"section_gap": 5,
|
| 13 |
+
"photo_stroke_width": 2,
|
| 14 |
+
"brand_bottom_offset": 110
|
| 15 |
},
|
| 16 |
"overlays": {
|
| 17 |
"logo_size_small": 70,
|
core/layout_engine.py
CHANGED
|
@@ -41,7 +41,7 @@ def load_settings():
|
|
| 41 |
"dpi": 300, "output_w_cm": 25.7, "output_h_cm": 12.7,
|
| 42 |
"grid_rows": 2, "grid_cols": 4, "grid_gap": 10, "grid_margin": 15,
|
| 43 |
"photo_bottom_pad_cm": 0.7, "brand_border": 50, "section_gap": 5,
|
| 44 |
-
"photo_stroke_width": 1
|
| 45 |
},
|
| 46 |
"overlays": {
|
| 47 |
"logo_size_small": 77, "logo_size_large": 95, "logo_margin": 8,
|
|
@@ -326,7 +326,7 @@ def generate_layout(input_image: Image.Image, person_name: str = "", id_number:
|
|
| 326 |
|
| 327 |
if add_studio_name:
|
| 328 |
btb = f_brand.getbbox("EL HELAL Studio")
|
| 329 |
-
draw.text((bx + (brand_w - (btb[2]-btb[0]))//2, OUTPUT_HEIGHT -
|
| 330 |
|
| 331 |
canvas.info["dpi"] = (DPI, DPI)
|
| 332 |
return canvas
|
|
|
|
| 41 |
"dpi": 300, "output_w_cm": 25.7, "output_h_cm": 12.7,
|
| 42 |
"grid_rows": 2, "grid_cols": 4, "grid_gap": 10, "grid_margin": 15,
|
| 43 |
"photo_bottom_pad_cm": 0.7, "brand_border": 50, "section_gap": 5,
|
| 44 |
+
"photo_stroke_width": 1, "brand_bottom_offset": 110
|
| 45 |
},
|
| 46 |
"overlays": {
|
| 47 |
"logo_size_small": 77, "logo_size_large": 95, "logo_margin": 8,
|
|
|
|
| 326 |
|
| 327 |
if add_studio_name:
|
| 328 |
btb = f_brand.getbbox("EL HELAL Studio")
|
| 329 |
+
draw.text((bx + (brand_w - (btb[2]-btb[0]))//2, OUTPUT_HEIGHT - S["layout"]["brand_bottom_offset"]), "EL HELAL Studio", fill=WHITE, font=f_brand)
|
| 330 |
|
| 331 |
canvas.info["dpi"] = (DPI, DPI)
|
| 332 |
return canvas
|