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

Updated patterns to support base64 data urls #117

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

upta
Copy link

@upta upta commented Apr 5, 2020

I had a use case where I'm using the slider in a preview before the user uploads files to the server, so I only have base64 data urls.

The loader would just hang because it wouldn't know what to do with them when I tried to navigate to the second image in the list.

I simply updated the pattern matching to understand the base64's prefix in addition to the file extensions it already supported.

I had a use case where I'm using the slider in a preview before the user uploads files to the server, so I only have base64 data urls.

The loader would just hang because it wouldn't know what to do with them when I tried to navigate to the second image in the list.

I simply updated the pattern matching to understand the base64's prefix in addition to the file extensions it already supported.
@TrainedLoop
Copy link

URLs without extensions also don't work :(

@upta
Copy link
Author

upta commented Jul 24, 2020

@dankobaia I ran into that as well while developing my site. Fortunately in my case I had full control over my images so I just switched to tacking on a file extension. I couldn't think of a good way to update the slider to support them.

If you didn't have control over the images themselves, I wonder if you couldn't trick the slider by adding a query string or a hash to the end of them, so the browser won't actually care but the slider's regex will see it as an image (e.g. https://test.com/image-with-extension?.jpg)

@MartinDariusRedBee
Copy link

Can anyone merge this PR?

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

3 participants