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

Output filename extension can take precedence over format #344

Closed
ubaltaci opened this issue Jan 25, 2016 · 3 comments
Closed

Output filename extension can take precedence over format #344

ubaltaci opened this issue Jan 25, 2016 · 3 comments
Labels
Milestone

Comments

@ubaltaci
Copy link

Hi, I don't know it is an expected behaviour or not, but I could not found similar issue or docs about it.

while Sharp("test_image.png").jpeg().toFile("test.jpeg") converts png to jpeg correctly,
if I change output file extension something different than jpeg, it keeps png formatSharp("test_image.png").jpeg().toFile("test.tmp")

sharp 0.12.2
vips 8.2.1
node v4.2.6
OS X 10.11

@lovell
Copy link
Owner

lovell commented Jan 26, 2016

Hello, good spot on this. You're quite right that the output filename extension takes precedence over any output format, and if it can't be parsed will revert to the input format. Thanks for reporting!

@lovell lovell added the bug label Jan 26, 2016
@lovell lovell changed the title Output options and filename Output filename extension can take precedence over format Jan 30, 2016
@lovell
Copy link
Owner

lovell commented Feb 7, 2016

Commit 677b2b9 adds a fix and test case for this scenario.

@lovell lovell added this to the v0.13.0 milestone Feb 7, 2016
@lovell
Copy link
Owner

lovell commented Feb 15, 2016

v0.13.0 now available with this fix, thanks for the original report.

@lovell lovell closed this as completed Feb 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants