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

Images served without a file extension are not displayed properly #362

Open
ojathelonius opened this issue Jun 8, 2018 · 4 comments
Open

Comments

@ojathelonius
Copy link

Since content is determined with regex, static files that are not served with their file extension (either as a base64 image, or served with a given route) are not displayed properly.

Example

Featherlight could check the response headers through jQuery's XHR parameter instead of analyzing the URL structure to determine the content-type ; there could also be a way to force the expected content ignoring the regex matches. I may have misunderstood the docs but couldn't find a way to do this yet.

@ponschab
Copy link

ponschab commented Dec 5, 2018

If you know for sure that you want to load images into Featherlight, you can set the attribute data-featherlight-type="image".

@marcandre
Copy link
Collaborator

Sorry I never chimed back on this. I don't see anything special in the example

@ojathelonius
Copy link
Author

I probably pasted he wrong jsfiddle sorry ! I will try and replicate the issue and post a proper link.

@ojathelonius
Copy link
Author

If you know for sure that you want to load images into Featherlight, you can set the attribute data-featherlight-type="image".

I can't believe I missed this in the docs. It seems to work just fine, as per this JSFiddle.

It would still be possible to automatically enforce the data type based on content-type in response headers, if provided.

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

3 participants