Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small pictures cannot be uploaded, but we know it too late #4219

Closed
monsieurtanuki opened this issue Jun 20, 2023 · 7 comments · Fixed by #4224
Closed

Small pictures cannot be uploaded, but we know it too late #4219

monsieurtanuki opened this issue Jun 20, 2023 · 7 comments · Fixed by #4224
Assignees
Labels
🐛 bug Something isn't working

Comments

@monsieurtanuki
Copy link
Contributor

What

  • When we try to upload a picture that is deemed too small by the server, we get a localized error message at the background task level and that's it.
    "Background task error (Exception: Could not upload picture: status not ok / La photo est trop petite. Attention à ne pas envoyer de photos prises sur Internet. Merci de n'envoyer que vos propres photos.)"
  • And the background task will be run again and again, and will always fail.
  • That brings inconsistency, as on the server the picture is not visible (as it was never uploaded) and on the user device the picture is considered OK.

Several solutions:

  • know in advance the limit sizes of the pictures for the server, so that we can reject from the app pictures that are too small
  • know when a picture was rejected because it was too small - for the moment we only get a localized message AFAIK (and it could fail for other reasons)
  • be able to warn the user that the picture was rejected because it was too small, and clean the device by removing the transient file and the background task

Steps to reproduce the behavior

  1. Try to upload a very small picture
  2. Go to the background task page
  3. See that background task is still there, and failed
@monsieurtanuki
Copy link
Contributor Author

@stephanegigandet What is the minimum size (in pixels) of a picture that we upload, below which the server rejects it?

@stephanegigandet
Copy link
Contributor

@monsieurtanuki here's the size requirement server side:

# Check the image is big enough so that we do not get thumbnails from other sites
		if (
			(($source->Get('width') < 640) and ($source->Get('height') < 160))

@stephanegigandet
Copy link
Contributor

so we need an image with a width >= 640, or a height >= 160

@monsieurtanuki monsieurtanuki self-assigned this Jun 21, 2023
@monsieurtanuki
Copy link
Contributor Author

@stephanegigandet Thank you, I'll impact that in Smoothie.

@monsieurtanuki
Copy link
Contributor Author

@stephanegigandet By the way it looks like the 640x160 minimum size is enforced on the server side for new picture uploads, but not the crop on existing pictures, am I right?

@stephanegigandet
Copy link
Contributor

@stephanegigandet By the way it looks like the 640x160 minimum size is enforced on the server side for new picture uploads, but not the crop on existing pictures, am I right?

@monsieurtanuki that's correct, the size is only for the upload of the image, not the cropping.

@monsieurtanuki
Copy link
Contributor Author

@monsieurtanuki that's correct, the size is only for the upload of the image, not the cropping.

@stephanegigandet OK, then we're done in Smoothie: we enforce the minimum size only for image uploads.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Development

Successfully merging a pull request may close this issue.

2 participants