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

Proposal: Change how emitted file name extensions are handled #13

Closed
alex-ketch opened this issue Aug 16, 2016 · 1 comment
Closed

Proposal: Change how emitted file name extensions are handled #13

alex-ketch opened this issue Aug 16, 2016 · 1 comment

Comments

@alex-ketch
Copy link
Collaborator

Would you be open to a PR to change how the file extension is attached to the base file name?

I'm wary as it could potentially be breaking change, but it seems odd—and not in line with other loaders—that you need to include a trailing period when including a name query.

For instance with a file named test.jpg:
responsive?name=[name]-[width].[ext] outputs test-500.jpgjpg
responsive?name=[name]-[width] outputs test-500jpg
responsive?name=[name]-[width]. outputs test-500.jpg (note the trailing period in the query)

The PR would make it so that:

  • A query without a name parameter would use the default file extension
  • A query with a name parameter would require a full naming structure (`[name]-[width].[ext])
  • A query with an explicitly named extension would convert the file to that type and use that extension (as currently handled)
@jstcki
Copy link
Contributor

jstcki commented Aug 18, 2016

Yeah, that sounds great!

I'm not 100% sure about the last case though. What would happen when you specify responsive?name=[name].jpg&ext=png? I think I'm against detecting the file type from the file name, and keep using the ext (or maybe that should be type) parameter for that.

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

2 participants