mirror of https://gitlab.com/bashrc2/epicyon
Option to enable image watermark
parent
5c64462a5e
commit
55fc741046
|
@ -868,6 +868,36 @@ def _profile_post_no_seen_posts(base_dir: str, nickname: str, domain: str,
|
|||
no_seen_posts_filename)
|
||||
|
||||
|
||||
def _profile_post_watermark_enabled(base_dir: str,
|
||||
nickname: str, domain: str,
|
||||
fields: {}) -> bool:
|
||||
""" HTTP POST apply watermark to image attachments
|
||||
"""
|
||||
watermark_enabled_filename = \
|
||||
acct_dir(base_dir, nickname, domain) + '/.watermarkEnabled'
|
||||
watermark_enabled = False
|
||||
if fields.get('watermarkEnabled'):
|
||||
if fields['watermarkEnabled'] == 'on':
|
||||
watermark_enabled = True
|
||||
if watermark_enabled:
|
||||
if not os.path.isfile(watermark_enabled_filename):
|
||||
try:
|
||||
with open(watermark_enabled_filename, 'w+',
|
||||
encoding='utf-8') as fp_wm:
|
||||
fp_wm.write('\n')
|
||||
except OSError:
|
||||
print('EX: unable to write watermarkEnabled ' +
|
||||
watermark_enabled_filename)
|
||||
if not watermark_enabled:
|
||||
if os.path.isfile(watermark_enabled_filename):
|
||||
try:
|
||||
os.remove(watermark_enabled_filename)
|
||||
except OSError:
|
||||
print('EX: _profile_edit ' +
|
||||
'unable to delete ' +
|
||||
watermark_enabled_filename)
|
||||
|
||||
|
||||
def _profile_post_hide_follows(base_dir: str, nickname: str, domain: str,
|
||||
actor_json: {}, fields: {}, self,
|
||||
actor_changed: bool,
|
||||
|
@ -3023,6 +3053,8 @@ def profile_edit(self, calling_domain: str, cookie: str,
|
|||
fields)
|
||||
_profile_post_no_seen_posts(base_dir, nickname, domain,
|
||||
fields)
|
||||
_profile_post_watermark_enabled(base_dir, nickname, domain,
|
||||
fields)
|
||||
|
||||
notify_likes_filename = \
|
||||
acct_dir(base_dir, nickname, domain) + '/.notifyLikes'
|
||||
|
|
9
media.py
9
media.py
|
@ -774,7 +774,16 @@ def apply_watermark_to_image(base_dir: str, nickname: str, domain: str,
|
|||
return False
|
||||
if not os.path.isfile('/usr/bin/composite'):
|
||||
return False
|
||||
watermark_enabled_filename = \
|
||||
acct_dir(base_dir, nickname, domain) + '/.watermarkEnabled'
|
||||
if not os.path.isfile(watermark_enabled_filename):
|
||||
return False
|
||||
_, watermark_filename = get_watermark_file(base_dir, nickname, domain)
|
||||
if not watermark_filename:
|
||||
# does a default watermark filename exist?
|
||||
default_watermark_file = base_dir + '/manual/manual-watermark-ai.png'
|
||||
if os.path.isfile(default_watermark_file):
|
||||
watermark_filename = default_watermark_file
|
||||
if not watermark_filename:
|
||||
return False
|
||||
if not os.path.isfile(watermark_filename):
|
||||
|
|
|
@ -695,5 +695,6 @@
|
|||
"Press Enter to continue": "إضغط مفتاح الدخول للاستمرار",
|
||||
"PGP Public Key": "مفتاح PGP العام",
|
||||
"Don't show already seen posts": "لا تظهر المشاركات التي تمت مشاهدتها بالفعل",
|
||||
"Watermark image": "صورة العلامة المائية"
|
||||
"Watermark image": "صورة العلامة المائية",
|
||||
"Apply a watermark to uploaded images": "إضافة علامة مائية على الصور التي تم تحميلها"
|
||||
}
|
||||
|
|
|
@ -695,5 +695,6 @@
|
|||
"Press Enter to continue": "চালিয়ে যেতে এন্টার টিপুন",
|
||||
"PGP Public Key": "PGP পাবলিক কী",
|
||||
"Don't show already seen posts": "ইতিমধ্যে দেখা পোস্ট দেখাবেন না",
|
||||
"Watermark image": "ওয়াটারমার্ক ইমেজ"
|
||||
"Watermark image": "ওয়াটারমার্ক ইমেজ",
|
||||
"Apply a watermark to uploaded images": "আপলোড করা ছবিগুলিতে একটি জলছাপ প্রয়োগ করুন"
|
||||
}
|
||||
|
|
|
@ -695,5 +695,6 @@
|
|||
"Press Enter to continue": "Premeu Intro per continuar",
|
||||
"PGP Public Key": "Clau pública PGP",
|
||||
"Don't show already seen posts": "No mostris les publicacions ja vistes",
|
||||
"Watermark image": "Imatge de filigrana"
|
||||
"Watermark image": "Imatge de filigrana",
|
||||
"Apply a watermark to uploaded images": "Apliqueu una marca d'aigua a les imatges penjades"
|
||||
}
|
||||
|
|
|
@ -695,5 +695,6 @@
|
|||
"Press Enter to continue": "Pwyswch Enter i barhau",
|
||||
"PGP Public Key": "Allwedd Gyhoeddus PGP",
|
||||
"Don't show already seen posts": "Peidiwch â dangos postiadau a welwyd eisoes",
|
||||
"Watermark image": "Delwedd dyfrnod"
|
||||
"Watermark image": "Delwedd dyfrnod",
|
||||
"Apply a watermark to uploaded images": "Cymhwyso dyfrnod i ddelweddau sydd wedi'u llwytho i fyny"
|
||||
}
|
||||
|
|
|
@ -695,5 +695,6 @@
|
|||
"Press Enter to continue": "Drücken Sie die Eingabetaste, um fortzufahren",
|
||||
"PGP Public Key": "Öffentlicher PGP-Schlüssel",
|
||||
"Don't show already seen posts": "Bereits gesehene Beiträge nicht anzeigen",
|
||||
"Watermark image": "Wasserzeichenbild"
|
||||
"Watermark image": "Wasserzeichenbild",
|
||||
"Apply a watermark to uploaded images": "Hochgeladenen Bildern ein Wasserzeichen hinzufügen"
|
||||
}
|
||||
|
|
|
@ -695,5 +695,6 @@
|
|||
"Press Enter to continue": "Πατήστε Enter για να συνεχίσετε",
|
||||
"PGP Public Key": "Δημόσιο κλειδί PGP",
|
||||
"Don't show already seen posts": "Να μην εμφανίζονται οι αναρτήσεις που έχετε ήδη δει",
|
||||
"Watermark image": "Εικόνα υδατογραφήματος"
|
||||
"Watermark image": "Εικόνα υδατογραφήματος",
|
||||
"Apply a watermark to uploaded images": "Εφαρμόστε ένα υδατογράφημα στις μεταφορτωμένες εικόνες"
|
||||
}
|
||||
|
|
|
@ -695,5 +695,6 @@
|
|||
"Press Enter to continue": "Press Enter to continue",
|
||||
"PGP Public Key": "PGP Public Key",
|
||||
"Don't show already seen posts": "Don't show already seen posts",
|
||||
"Watermark image": "Watermark image"
|
||||
"Watermark image": "Watermark image",
|
||||
"Apply a watermark to uploaded images": "Apply a watermark to uploaded images"
|
||||
}
|
||||
|
|
|
@ -695,5 +695,6 @@
|
|||
"Press Enter to continue": "Presione Entrar para continuar",
|
||||
"PGP Public Key": "Clave pública PGP",
|
||||
"Don't show already seen posts": "No mostrar publicaciones ya vistas",
|
||||
"Watermark image": "Imagen de marca de agua"
|
||||
"Watermark image": "Imagen de marca de agua",
|
||||
"Apply a watermark to uploaded images": "Aplicar una marca de agua a las imágenes cargadas"
|
||||
}
|
||||
|
|
|
@ -695,5 +695,6 @@
|
|||
"Press Enter to continue": "برای ادامه Enter را فشار دهید",
|
||||
"PGP Public Key": "کلید عمومی PGP",
|
||||
"Don't show already seen posts": "پست های قبلا دیده شده را نشان ندهید",
|
||||
"Watermark image": "تصویر واترمارک"
|
||||
"Watermark image": "تصویر واترمارک",
|
||||
"Apply a watermark to uploaded images": "اعمال واترمارک روی تصاویر آپلود شده"
|
||||
}
|
||||
|
|
|
@ -695,5 +695,6 @@
|
|||
"Press Enter to continue": "Jatka painamalla Enter",
|
||||
"PGP Public Key": "PGP julkinen avain",
|
||||
"Don't show already seen posts": "Älä näytä jo nähtyjä viestejä",
|
||||
"Watermark image": "Vesileiman kuva"
|
||||
"Watermark image": "Vesileiman kuva",
|
||||
"Apply a watermark to uploaded images": "Lisää ladattuihin kuviin vesileima"
|
||||
}
|
||||
|
|
|
@ -695,5 +695,6 @@
|
|||
"Press Enter to continue": "Appuyez sur Entrée pour continuer",
|
||||
"PGP Public Key": "Clé publique PGP",
|
||||
"Don't show already seen posts": "Ne pas afficher les messages déjà vus",
|
||||
"Watermark image": "Image en filigrane"
|
||||
"Watermark image": "Image en filigrane",
|
||||
"Apply a watermark to uploaded images": "Appliquer un filigrane aux images téléchargées"
|
||||
}
|
||||
|
|
|
@ -695,5 +695,6 @@
|
|||
"Press Enter to continue": "Brúigh Enter chun leanúint ar aghaidh",
|
||||
"PGP Public Key": "Eochair Phoiblí PGP",
|
||||
"Don't show already seen posts": "Ná taispeáin postálacha atá feicthe cheana féin",
|
||||
"Watermark image": "Íomhá comhartha uisce"
|
||||
"Watermark image": "Íomhá comhartha uisce",
|
||||
"Apply a watermark to uploaded images": "Cuir comhartha uisce i bhfeidhm ar íomhánna uaslódáilte"
|
||||
}
|
||||
|
|
|
@ -695,5 +695,6 @@
|
|||
"Press Enter to continue": "לחץ על Enter כדי להמשיך",
|
||||
"PGP Public Key": "מפתח PGP ציבורי",
|
||||
"Don't show already seen posts": "אל תראה פוסטים שכבר נראו",
|
||||
"Watermark image": "תמונת סימן מים"
|
||||
"Watermark image": "תמונת סימן מים",
|
||||
"Apply a watermark to uploaded images": "החל סימן מים על תמונות שהועלו"
|
||||
}
|
||||
|
|
|
@ -695,5 +695,6 @@
|
|||
"Press Enter to continue": "जारी रखने के लिए Enter दबाएँ",
|
||||
"PGP Public Key": "पीजीपी सार्वजनिक कुंजी",
|
||||
"Don't show already seen posts": "पहले से देखी गई पोस्ट न दिखाएं",
|
||||
"Watermark image": "वॉटरमार्क छवि"
|
||||
"Watermark image": "वॉटरमार्क छवि",
|
||||
"Apply a watermark to uploaded images": "अपलोड की गई छवियों पर वॉटरमार्क लागू करें"
|
||||
}
|
||||
|
|
|
@ -695,5 +695,6 @@
|
|||
"Press Enter to continue": "Premere Invio per continuare",
|
||||
"PGP Public Key": "Chiave pubblica PGP",
|
||||
"Don't show already seen posts": "Non mostrare i post già visti",
|
||||
"Watermark image": "Immagine filigrana"
|
||||
"Watermark image": "Immagine filigrana",
|
||||
"Apply a watermark to uploaded images": "Applicare una filigrana alle immagini caricate"
|
||||
}
|
||||
|
|
|
@ -695,5 +695,6 @@
|
|||
"Press Enter to continue": "続行するには Enter キーを押してください",
|
||||
"PGP Public Key": "PGP公開鍵",
|
||||
"Don't show already seen posts": "すでに閲覧した投稿を表示しない",
|
||||
"Watermark image": "透かし画像"
|
||||
"Watermark image": "透かし画像",
|
||||
"Apply a watermark to uploaded images": "アップロードした画像に透かしを適用する"
|
||||
}
|
||||
|
|
|
@ -695,5 +695,6 @@
|
|||
"Press Enter to continue": "계속하려면 Enter를 누르세요.",
|
||||
"PGP Public Key": "PGP 공개 키",
|
||||
"Don't show already seen posts": "이미 본 게시물을 표시하지 않음",
|
||||
"Watermark image": "워터마크 이미지"
|
||||
"Watermark image": "워터마크 이미지",
|
||||
"Apply a watermark to uploaded images": "업로드한 이미지에 워터마크를 적용합니다"
|
||||
}
|
||||
|
|
|
@ -695,5 +695,6 @@
|
|||
"Press Enter to continue": "Ji bo berdewamkirinê Enter bikirtînin",
|
||||
"PGP Public Key": "Mifteya Giştî ya PGP",
|
||||
"Don't show already seen posts": "Mesajên ku berê hatine dîtin nîşan nedin",
|
||||
"Watermark image": "Wêneyê Watermark"
|
||||
"Watermark image": "Wêneyê Watermark",
|
||||
"Apply a watermark to uploaded images": "Li ser wêneyên barkirî ava nîşanek bicîh bikin"
|
||||
}
|
||||
|
|
|
@ -695,5 +695,6 @@
|
|||
"Press Enter to continue": "Druk op Enter om door te gaan",
|
||||
"PGP Public Key": "PGP publieke sleutel",
|
||||
"Don't show already seen posts": "Toon geen reeds bekeken berichten",
|
||||
"Watermark image": "Watermerk afbeelding"
|
||||
"Watermark image": "Watermerk afbeelding",
|
||||
"Apply a watermark to uploaded images": "Een watermerk toepassen op geüploade afbeeldingen"
|
||||
}
|
||||
|
|
|
@ -691,5 +691,6 @@
|
|||
"Press Enter to continue": "Press Enter to continue",
|
||||
"PGP Public Key": "PGP Public Key",
|
||||
"Don't show already seen posts": "Don't show already seen posts",
|
||||
"Watermark image": "Watermark image"
|
||||
"Watermark image": "Watermark image",
|
||||
"Apply a watermark to uploaded images": "Apply a watermark to uploaded images"
|
||||
}
|
||||
|
|
|
@ -695,5 +695,6 @@
|
|||
"Press Enter to continue": "Naciśnij Enter, aby kontynuować",
|
||||
"PGP Public Key": "Klucz publiczny PGP",
|
||||
"Don't show already seen posts": "Nie pokazuj już wyświetlonych postów",
|
||||
"Watermark image": "Obraz znaku wodnego"
|
||||
"Watermark image": "Obraz znaku wodnego",
|
||||
"Apply a watermark to uploaded images": "Zastosuj znak wodny do przesłanych obrazów"
|
||||
}
|
||||
|
|
|
@ -695,5 +695,6 @@
|
|||
"Press Enter to continue": "Pressione Enter para continuar",
|
||||
"PGP Public Key": "Chave pública PGP",
|
||||
"Don't show already seen posts": "Não mostrar posts já vistos",
|
||||
"Watermark image": "Imagem de marca de água"
|
||||
"Watermark image": "Imagem de marca de água",
|
||||
"Apply a watermark to uploaded images": "Aplicar uma marca de água nas imagens enviadas"
|
||||
}
|
||||
|
|
|
@ -695,5 +695,6 @@
|
|||
"Press Enter to continue": "Нажмите Enter, чтобы продолжить",
|
||||
"PGP Public Key": "Открытый ключ PGP",
|
||||
"Don't show already seen posts": "Не показывать уже просмотренные публикации",
|
||||
"Watermark image": "Изображение водяного знака"
|
||||
"Watermark image": "Изображение водяного знака",
|
||||
"Apply a watermark to uploaded images": "Накладывать водяной знак на загружаемые изображения"
|
||||
}
|
||||
|
|
|
@ -695,5 +695,6 @@
|
|||
"Press Enter to continue": "Bonyeza Enter ili kuendelea",
|
||||
"PGP Public Key": "Ufunguo wa Umma wa PGP",
|
||||
"Don't show already seen posts": "Usionyeshe machapisho ambayo tayari yameonekana",
|
||||
"Watermark image": "Picha ya watermark"
|
||||
"Watermark image": "Picha ya watermark",
|
||||
"Apply a watermark to uploaded images": "Tumia watermark kwa picha zilizopakiwa"
|
||||
}
|
||||
|
|
|
@ -695,5 +695,6 @@
|
|||
"Press Enter to continue": "Devam etmek için Enter'a basın",
|
||||
"PGP Public Key": "PGP Genel Anahtarı",
|
||||
"Don't show already seen posts": "Daha önce görülen gönderileri gösterme",
|
||||
"Watermark image": "Filigran resmi"
|
||||
"Watermark image": "Filigran resmi",
|
||||
"Apply a watermark to uploaded images": "Yüklenen görsellere filigran uygulayın"
|
||||
}
|
||||
|
|
|
@ -695,5 +695,6 @@
|
|||
"Press Enter to continue": "Натисніть Enter, щоб продовжити",
|
||||
"PGP Public Key": "Відкритий ключ PGP",
|
||||
"Don't show already seen posts": "Не показувати вже переглянуті публікації",
|
||||
"Watermark image": "Зображення водяного знака"
|
||||
"Watermark image": "Зображення водяного знака",
|
||||
"Apply a watermark to uploaded images": "Застосування водяного знака до завантажених зображень"
|
||||
}
|
||||
|
|
|
@ -695,5 +695,6 @@
|
|||
"Press Enter to continue": "דרוק אַרייַן צו פאָרזעצן",
|
||||
"PGP Public Key": "PGP ציבור שליסל",
|
||||
"Don't show already seen posts": "צי ניט ווייַזן שוין געזען אַרטיקלען",
|
||||
"Watermark image": "וואָטערמאַרק בילד"
|
||||
"Watermark image": "וואָטערמאַרק בילד",
|
||||
"Apply a watermark to uploaded images": "צולייגן אַ וואָטערמאַרק צו ופּלאָאַדעד בילדער"
|
||||
}
|
||||
|
|
|
@ -695,5 +695,6 @@
|
|||
"Press Enter to continue": "按 Enter 继续",
|
||||
"PGP Public Key": "PGP 公钥",
|
||||
"Don't show already seen posts": "不显示已经看过的帖子",
|
||||
"Watermark image": "水印图像"
|
||||
"Watermark image": "水印图像",
|
||||
"Apply a watermark to uploaded images": "将水印应用于上传的图像"
|
||||
}
|
||||
|
|
|
@ -2821,7 +2821,8 @@ def _html_edit_profile_options(is_admin: bool,
|
|||
hide_follows: bool,
|
||||
premium: bool,
|
||||
no_reply_boosts: bool,
|
||||
no_seen_posts: bool) -> str:
|
||||
no_seen_posts: bool,
|
||||
watermark_enabled: bool) -> str:
|
||||
"""option checkboxes section of edit profile screen
|
||||
"""
|
||||
edit_profile_form = ' <div class="container">\n'
|
||||
|
@ -2915,6 +2916,10 @@ def _html_edit_profile_options(is_admin: bool,
|
|||
edit_profile_form += \
|
||||
edit_check_box(no_seen_posts_str, 'noSeenPosts', no_seen_posts)
|
||||
|
||||
watermark_str = translate["Apply a watermark to uploaded images"]
|
||||
edit_profile_form += \
|
||||
edit_check_box(watermark_str, 'watermarkEnabled', watermark_enabled)
|
||||
|
||||
edit_profile_form += ' </div>\n'
|
||||
return edit_profile_form
|
||||
|
||||
|
@ -3342,6 +3347,12 @@ def html_edit_profile(server, translate: {},
|
|||
if os.path.isfile(no_seen_posts_filename):
|
||||
no_seen_posts = True
|
||||
|
||||
# is watermarking enabled?
|
||||
watermark_enabled_filename = account_dir + '/.watermarkEnabled'
|
||||
watermark_enabled = False
|
||||
if os.path.isfile(watermark_enabled_filename):
|
||||
watermark_enabled = True
|
||||
|
||||
# Option checkboxes
|
||||
edit_profile_form += \
|
||||
_html_edit_profile_options(is_admin, manually_approves_followers,
|
||||
|
@ -3356,7 +3367,7 @@ def html_edit_profile(server, translate: {},
|
|||
show_vote_posts, show_replies_followers,
|
||||
show_replies_mutuals, hide_follows,
|
||||
premium, no_reply_boosts,
|
||||
no_seen_posts)
|
||||
no_seen_posts, watermark_enabled)
|
||||
|
||||
# Contact information
|
||||
edit_profile_form += \
|
||||
|
|
Loading…
Reference in New Issue