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

When saving tiff, .tif occurs twice in filename #46

Open
marthinwurer opened this issue Oct 8, 2019 · 5 comments
Open

When saving tiff, .tif occurs twice in filename #46

marthinwurer opened this issue Oct 8, 2019 · 5 comments

Comments

@marthinwurer
Copy link

In code:

    one_deg.to_tiff(os.path.expanduser("~/path/to/dir/one_deg.tif"))

In file:

$ ls
one_deg.tif.tif

I expected that the file would just be named one_deg.tif, not .tif.tif

@ozak
Copy link
Owner

ozak commented Oct 8, 2019

Well since it is a to_tiff method, it assumes the you want the ending to be .tif. You do not need to assign it. I guess it is a preference issue.

@marthinwurer
Copy link
Author

I could throw together a PR to check the ending of the path given, and just not add it if it's like tif or tiff or capitalized versions of those. Would that be acceptable?

@ozak
Copy link
Owner

ozak commented Oct 8, 2019

sure!

@ozak
Copy link
Owner

ozak commented Oct 8, 2019

I guess one could just put a replace on the string to delete any tif/tiff/TIF/TIFF endings

@marthinwurer
Copy link
Author

marthinwurer commented Oct 8, 2019

Yeah, there are a few things that could be done. I'll take a look at the code and see which will work best. I'd prefer to err on the side of the user, as they're expecting what they put in to be what they get.

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

2 participants