irelephant [he/him]@lemmy.dbzer0.com to Fediverse@lemmy.worldEnglish · 15 days agoFun fact: you can't upload this image on piefed.sociallemmy.dbzer0.comimagemessage-square20linkfedilinkarrow-up11arrow-down10file-text
arrow-up11arrow-down1imageFun fact: you can't upload this image on piefed.sociallemmy.dbzer0.comirelephant [he/him]@lemmy.dbzer0.com to Fediverse@lemmy.worldEnglish · 15 days agomessage-square20linkfedilinkfile-text
https://codeberg.org/rimu/pyfedi/src/commit/6405e51dab23f43eaea18d0ee4d9e7a773a3fd31/app/community/forms.py#L335 deliberately misleading error message.
minus-squareirelephant [he/him]@lemmy.dbzer0.comOPlinkfedilinkEnglisharrow-up0·15 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)
minus-squareZombiFrancis@sh.itjust.workslinkfedilinkEnglisharrow-up1·15 days ago current_user.reputation -= 1 So what exactly is going on there?
minus-squaregoferking (he/him)@lemmy.sdf.orglinkfedilinkEnglisharrow-up1·14 days agoPiefed punishes users for wrong think/not acting like the creator wants
The 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)
So what exactly is going on there?
Piefed punishes users for wrong think/not acting like the creator wants