Open xtraorange opened 3 weeks ago
I can upload a .jpeg just fine. Created one in MS Paint and uploaded: https://demo.mealie.io/g/home/r/pannkakor
I expect there's something wrong with the images on that website. Here's the check it's failing: https://github.com/mealie-recipes/mealie/blob/f53cae7c7b099f4489ecc0391ef62927631d7a77/mealie/services/recipe/recipe_data_service.py#L154-L158
I can upload a .jpeg just fine. Created one in MS Paint and uploaded: https://demo.mealie.io/g/home/r/pannkakor
I expect there's something wrong with the images on that website. Here's the check it's failing:
I mentioned that uploading works fine, it's only scraping or attempting to use a URL of an image with a .jpeg.
It looks like the failure is because it thinks that's not an image, which could be because it doesn't recognize .jpeg as a valid image extension.
It's the Content-Type header returned from the S3 bucket that's causing the issue. We trust the Content Type to ensure that it's actually an image, we'd either have to try to parse the contents, or determine some other way to check if it's an image
I wonder why the .jpg images on the same site work then? How strange. Well, thanks for looking into it!
First Check
What is the issue you are experiencing?
When either using the scraper or using the get image by URL dialogue, Mealie is unable to identify a .jpeg. Produces a "Url is not an image" error when using the get image by URL dialogue. Interestingly, uploading from a computer works fine.
Steps to Reproduce
OR
Please provide relevant logs
INFO 2024-06-07T13:41:45 - Image URL: https://emeals-menubuilder.s3.amazonaws.com/v1/recipes/766433/pictures/large_shrimp-and-sausage-jambalaya.jpeg INFO 2024-06-07T13:41:45 - HTTP Request: GET https://emeals-menubuilder.s3.amazonaws.com/v1/recipes/766433/pictures/large_shrimp-and-sausage-jambalaya.jpeg "HTTP/1.1 200 OK" ERROR 2024-06-07T13:41:46 - Content-Type: binary/octet-stream is not an image ERROR 2024-06-07T13:41:46 - Content-Type: binary/octet-stream is not an image
Mealie Version
v1.8.0 - 583bd742fb7bbeee0191a6e6601677df57d86a11
Deployment
Docker (Linux)
Additional Deployment Details
No response