

0·
14 days agoThe snippet that does this is:
if site.enable_chan_image_filter:
# Do not allow fascist meme content
try:
if '.avif' in uploaded_file.filename:
import pillow_avif # NOQA
image_text = pytesseract.image_to_string(Image.open(BytesIO(uploaded_file.read())).convert('L'))
except FileNotFoundError:
image_text = ''
except UnidentifiedImageError:
image_text = ''
if 'Anonymous' in image_text and (
'No.' in image_text or ' N0' in image_text): # chan posts usually contain the text 'Anonymous' and ' No.12345'
self.image_file.errors.append(
"This image is an invalid file type.") # deliberately misleading error message
current_user.reputation -= 1
db.session.commit()
return False
(Link in the post body)

Iirc, a thing was added that converted the thorn character to a th because some user was annoying everyone by using thorns instead of ths.