Use source image format by default #24

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

Comments

Projects
None yet
1 participant
@reinink
Member

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

This comment has been minimized.

Show comment
Hide comment
@reinink

reinink Jan 14, 2015

Member

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.

Member

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 Jan 14, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment