Spaces:
Running
Running
Tu Nombre commited on
Commit ·
05d246f
1
Parent(s): 9cef76a
fix imagemagick policy cliente
Browse files- cliente_template.py +6 -0
cliente_template.py
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import os, asyncio, time, random, requests, threading
|
| 2 |
import PIL.Image
|
| 3 |
if not hasattr(PIL.Image, "ANTIALIAS"): PIL.Image.ANTIALIAS = PIL.Image.LANCZOS
|
|
|
|
| 1 |
+
import subprocess
|
| 2 |
+
try:
|
| 3 |
+
subprocess.run(["sed", "-i", 's/rights="none"/rights="read|write"/g', "/etc/ImageMagick-6/policy.xml"], capture_output=True)
|
| 4 |
+
subprocess.run(["sed", "-i", 's/rights="none"/rights="read|write"/g', "/etc/ImageMagick-7/policy.xml"], capture_output=True)
|
| 5 |
+
except: pass
|
| 6 |
+
|
| 7 |
import os, asyncio, time, random, requests, threading
|
| 8 |
import PIL.Image
|
| 9 |
if not hasattr(PIL.Image, "ANTIALIAS"): PIL.Image.ANTIALIAS = PIL.Image.LANCZOS
|