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

Use source image format by default #24

Closed
reinink opened this issue Jan 13, 2015 · 1 comment
Closed

Use source image format by default #24

reinink opened this issue Jan 13, 2015 · 1 comment

Comments

@reinink
Copy link
Contributor

reinink commented Jan 13, 2015

Right now Glide automatically outputs images as jpg if no format (fm) parameter has been set. However, this isn't always ideal. For example, if you have a transparent png you may want it to remain a png. I'd like to improve this somehow. Glide can either:

  1. Default to the source image format by default, or
  2. Add a new fm option to specify using the original, ie: kayaks.jpg?fm=src

I'm sort of leaning towards the first option. That seems to be what Imgix is doing as well:

The output format to convert the image to. Valid values are jpg and png. The default value is to use the file format of the input image.

Thoughts?

@reinink
Copy link
Contributor Author

reinink commented Jan 14, 2015

Decided on option 1, and implemented here: 44a6fa4

Primary reason being that unless an image manipulation has been specified, it shouldn't occur. This is in keeping with how other manipulations operate. It may mean adding fm=jpg to most URLs, but I see the value in having it explicitly set.

@reinink reinink closed this as completed Jan 14, 2015
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