-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Added compression option to save TIFF images #8531
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
Closed
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
073f1b9
Add LZW compression option to save TIFF images
14d0c30
Improved adhesion to code standards
ad850c2
Added TiffImagePlugin import required in print_tif
f4055ec
Fix typo that broke building process
1ed0ef9
Add comments and better spacing for TIFF LZW
fe523c4
Added "compression" as parameter that is passed to PIL backend
renato-umeton f3e730f
Fixed variable names and polished code a bit more
renato-umeton ca69a47
Removed unused import
renato-umeton bdb8066
Code polishing
renato-umeton File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add comments and better spacing for TIFF LZW
- Loading branch information
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it ok to simplify this as?
Or are there instances where the user needs TiffImagePlugin.WRITE_LIBTIFF to be True even when writing out a non-compressed image?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I'll add the test part.
I'd say it is not OK to "simplify" because you may use the flag somewhere else and remain confused about it not getting back to its original state once finished saving the image.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably better to use try:... finally:... to handle the case where the saving fails.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@story645 I'm having some issues coming up with some meaningful tests since we now do a pull pass-through of the parameters to the backend. Can you suggest some tests, if needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check that the arg is getting passed through properly and that what this function saves out is a valid compressed tiff file (just try one compression arg parameter, does not matter which one).