troubleshooting nsfw filter for gif

master
lza_menace 2 years ago
parent 44d1201de7
commit 3cc3a365c1

@ -114,20 +114,18 @@ class Artwork(pw.Model):
_frames = thumbnails(frames)
_image = next(_frames)
_image.info = image.info
_image.save(t, format=image.format, save_all=True, append_images=list(_frames), disposal=2)
_image.save(t, save_all=True, append_images=list(_frames), disposal=2)
else:
image.thumbnail(size, Image.ANTIALIAS)
if self.nsfw:
image = image.filter(ImageFilter.GaussianBlur(radius = 4))
image.save(t, format=image.format)
image.close()
self.thumbnail = _t
self.save()
return True
except:
except Exception as e:
print(e)
return False
class Meta:

@ -11,6 +11,9 @@
</h6>
<p class="artworkDescription">{{ artwork.description }}</p>
<div class="row">
{% if current_user.is_authenticated and current_user.is_admin %}
<a href="{{ url_for('artwork.manage', id=artwork.id, action='regenerate_thumbnail') }}"><button class="button">Regen Thumbnail</button></a>
{% endif %}
{% if not artwork.approved %}
{% if artwork.hidden %}
<a href="{{ url_for('artwork.manage', id=artwork.id, action='delete') }}"><button class="button-secondary">Delete</button></a>
@ -18,12 +21,6 @@
<a href="{{ url_for('artwork.manage', id=artwork.id, action='reject') }}"><button class="button">Reject</button></a>
{% endif %}
<a href="{{ url_for('artwork.manage', id=artwork.id, action='approve') }}"><button class="button-primary">Approve</button></a>
{% endif %}
{% if current_user.is_authenticated and current_user.is_admin %}
<span class="ml-4">
<a href="{{ url_for('artwork.manage', id=artwork.id, action='regenerate_thumbnail') }}"><button class="button">Regen Thumbnail</button></a>
</span>
{% endif %}
</div>
</div>

Loading…
Cancel
Save