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

✨fix an issue where images downloaded in safari browser on iphone are text files #1977

Closed
wants to merge 2 commits into from

Conversation

Yanyutin753
Copy link
Contributor

Pull Request Checklist


Description

✨fix an issue where images downloaded in safari browser on iphone are text files


Changelog Entry

Added

  • Not specifically cited Mime-types, i created a MimeTypes to get MimeType from file name suffixes.

Fixed

  • fix an issue where images downloaded in safari browser on iphone are text files

Additional Information

  • Through the self-test, now i can download the corresponding file

@tjbck
Copy link
Contributor

tjbck commented May 6, 2024

Thanks for the PR! This should be fixed on dev, added you as a co-author as well. Let me know if the issue persists!

@tjbck tjbck closed this May 6, 2024
@Yanyutin753
Copy link
Contributor Author

Thanks for the PR! This should be fixed on dev, added you as a co-author as well. Let me know if the issue persists!

thanks!

@Yanyutin753
Copy link
Contributor Author

Yanyutin753 commented May 6, 2024

@tjbck

Find first bug in the mimetypes.guess_extension(mime_type)

sometime, if the type of my image is image/webp , this code will work incorrectly !
it will return none😂

so that i change the code like this

image_format = (
    ".webp"
    if mime_type == "image/webp"
    else mimetypes.guess_extension(mime_type) or ".png"
)

The second bug is that when I download an image using ios safari, it doesn't recognize my image type, so it saves it as a text file and can't be saved properly. I'm not sure if this is a situation that everyone uses

Thanks the author for his efforts

@Yanyutin753 Yanyutin753 deleted the download-dev branch May 10, 2024 03:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants