We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 49f6f89 commit 23a8192Copy full SHA for 23a8192
1 file changed
ietf/person/views.py
@@ -99,8 +99,11 @@ def photo(request, email_or_name):
99
img = Image.open(person.photo)
100
img = img.resize((size, img.height*size//img.width))
101
bytes = BytesIO()
102
- img.save(bytes, format='JPEG')
103
- return HttpResponse(bytes.getvalue(), content_type='image/jpg')
+ try:
+ img.save(bytes, format='JPEG')
104
+ return HttpResponse(bytes.getvalue(), content_type='image/jpg')
105
+ except OSError:
106
+ raise Http404
107
108
109
@role_required("Secretariat")
0 commit comments