Skip to content

Can't save as image with unusual extension #133

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

Closed
Nakilon opened this issue Sep 19, 2017 · 2 comments
Closed

Can't save as image with unusual extension #133

Nakilon opened this issue Sep 19, 2017 · 2 comments
Labels

Comments

@Nakilon
Copy link
Contributor

Nakilon commented Sep 19, 2017

I would like to save some temporal files with extension .temp but I get No known saver for '1.temp'. (Vips::Error)

Thing like this would be nice:

def write_to_file name, type = nil, opts = {}
  ...
  saver = Vips::vips_foreign_find_save(type || filename)
im.write_to_file "1.temp", "png"
@jcupitt
Copy link
Member

jcupitt commented Sep 19, 2017

Hello, write_to_file uses the extension to decide what saver to use, so it has to be a known extension.

You can call pngsave directly, for example:

im.pngsave "1.temp"

Would that work?

@Nakilon
Copy link
Contributor Author

Nakilon commented Sep 20, 2017

Yeah seems to work fine. Thanks.

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