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

Suggestion: Add a flag to disable mapping the media URL to params (.png to ?format=png) #185

Open
0x-DLN opened this issue Dec 21, 2024 · 1 comment

Comments

@0x-DLN
Copy link

0x-DLN commented Dec 21, 2024

My use case is that I'm also archiving tweets, in case they get deleted. I'm storing them in buckets (like AWS S3) in a filename.extension format, so like image.jpg, video.mp4, etc.

The problem I'm running into is that for images the URL gets mapped to filename?format=extension&name=small, e.g. image?format=jpg&name=small. From my testing, when using the X/Twitter CDN both variants work, and return the exact same image.

I propose adding an optional flag to MediaImgProps which gets passed down to getMediaUrl to make the URL params conditional.

The flag's default value should keep the current functionality.

If this conceptually sounds okay, I'll make a PR.

@0x-DLN
Copy link
Author

0x-DLN commented Dec 21, 2024

Actually, this needs additional work as a video/gif thumbnail doesn't follow the same path.

I'm not sure how to fix this for thumbnails without allowing a custom video element here and then passing it down, but that seems very messy...

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

No branches or pull requests

1 participant