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

RFC - Throw an exception if an invalid value format is provided instead of silently converting it to jpg. #416

Open
ADmad opened this issue Dec 19, 2024 · 3 comments
Milestone

Comments

@ADmad
Copy link
Collaborator

ADmad commented Dec 19, 2024

Currently any invalid value for fm gets silently coerced to jpg by the encoder. This behavior, while ensure an image is always generated, has couple of issues.

  • A dev error like a typo in the format name would be difficult to track down since the lib gives no error about it.
  • Since all parameter values are used to generate the hash key using multiple invalid value for fm would generate multiple cached images which would be actually the same.

Based on the community feedback I would like to throw an exception instead for an invalid format value.

Tagging in recent contributors to the 3.x branch @deluxetom @Art4 @nlemoine @konnng-dev

@ADmad ADmad added this to the 3.x milestone Dec 19, 2024
@Art4
Copy link

Art4 commented Dec 19, 2024

What about throwing an exception and adding an option for a default format on invalid fm.

@deluxetom
Copy link

@Art4 I like that idea, it would need to be defined as a preset, right?

@ADmad
Copy link
Collaborator Author

ADmad commented Dec 20, 2024

What about throwing an exception and adding an option for a default format on invalid fm.

So if the default format option is set that would be used instead throwing an exception in case of an invalid fm? I too like the idea.

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