diff --git a/wagtail/wagtailimages/tests.py b/wagtail/wagtailimages/tests.py index 58c7207bf..4b0de3a2f 100644 --- a/wagtail/wagtailimages/tests.py +++ b/wagtail/wagtailimages/tests.py @@ -564,7 +564,7 @@ class TestMultipleImageUploader(TestCase, WagtailTestUtils): self.assertIn('success', response_json) self.assertIn('error_message', response_json) self.assertFalse(response_json['success']) - self.assertEqual(response_json['error_message'], 'Not a valid image. Please use a gif, jpeg or png file with the correct file extension.') + self.assertEqual(response_json['error_message'], 'Not a valid image. Please use a gif, jpeg or png file with the correct file extension (*.gif, *.jpg or *.png).') def test_edit_get(self): """ diff --git a/wagtail/wagtailimages/utils.py b/wagtail/wagtailimages/utils.py index 17903ce93..4d10e2360 100644 --- a/wagtail/wagtailimages/utils.py +++ b/wagtail/wagtailimages/utils.py @@ -14,7 +14,7 @@ def validate_image_format(f): extension = 'jpeg' if extension not in ['gif', 'jpeg', 'png']: - raise ValidationError(_("Not a valid image. Please use a gif, jpeg or png file with the correct file extension.")) + raise ValidationError(_("Not a valid image. Please use a gif, jpeg or png file with the correct file extension (*.gif, *.jpg or *.png).")) if not f.closed: # Open image file @@ -25,11 +25,11 @@ def validate_image_format(f): image = Image.open(f) except IOError: # Uploaded file is not even an image file (or corrupted) - raise ValidationError(_("Not a valid image. Please use a gif, jpeg or png file with the correct file extension.")) + raise ValidationError(_("Not a valid image. Please use a gif, jpeg or png file with the correct file extension (*.gif, *.jpg or *.png).")) f.seek(file_position) # Check that the internal format matches the extension # It is possible to upload PSD files if their extension is set to jpg, png or gif. This should catch them out if image.format.upper() != extension.upper(): - raise ValidationError(_("Not a valid %s image. Please use a gif, jpeg or png file with the correct file extension.") % (extension.upper())) + raise ValidationError(_("Not a valid %s image. Please use a gif, jpeg or png file with the correct file extension (*.gif, *.jpg or *.png).") % (extension.upper()))