Añadir mu-plugins y scripts de feadulta

This commit is contained in:
2026-06-28 15:10:46 -04:00
parent bce7e42f44
commit b6116b066d
106 changed files with 17600 additions and 2 deletions
+33
View File
@@ -0,0 +1,33 @@
#!/usr/bin/env python3
"""Issue #90 — círculo 200px RGBA (esquinas transparentes) para 2 autores nuevos.
Recorte cuadrado centrado en la cara + máscara circular supersampleada.
"""
from PIL import Image, ImageDraw
SRC = "/home/rafa/Feadulta"
OUT = "/home/rafa/joomla-migration/wordpress/wp-content/uploads/avatares/autores"
SIZE = 200
SS = 4 # supersampling para borde suave
# foto, uid, (left, top, side) recorte cuadrado en coords del original
JOBS = [
("MP_Lopez.jpeg", 474, (120, 0, 880)),
("A_delaCruz.jpeg", 993, (128, 0, 785)),
]
mask = Image.new("L", (SIZE * SS, SIZE * SS), 0)
ImageDraw.Draw(mask).ellipse((0, 0, SIZE * SS - 1, SIZE * SS - 1), fill=255)
mask = mask.resize((SIZE, SIZE), Image.LANCZOS)
for fname, uid, (l, t, side) in JOBS:
im = Image.open(f"{SRC}/{fname}").convert("RGB")
W, H = im.size
# clamp dentro de la imagen
l = max(0, min(l, W - side))
t = max(0, min(t, H - side))
crop = im.crop((l, t, l + side, t + side)).resize((SIZE, SIZE), Image.LANCZOS)
out = Image.new("RGBA", (SIZE, SIZE), (0, 0, 0, 0))
out.paste(crop, (0, 0))
out.putalpha(mask)
out.save(f"{OUT}/autor-{uid}.png")
print(f"OK autor-{uid}.png <- {fname} crop=({l},{t},{side})")