Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fix tiff and jpeg export via PIL #970

Merged
merged 1 commit into from

3 participants

@cgohlke

Fix issue #962

@mdboom
Owner

+1

@pelson
Collaborator

Agreed.

@mdboom mdboom merged commit 6a362e4 into matplotlib:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 28, 2012
  1. @cgohlke
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/matplotlib/backend_bases.py
View
4 lib/matplotlib/backend_bases.py
@@ -1883,7 +1883,7 @@ def print_jpg(self, filename_or_obj, *args, **kwargs):
image = Image.frombuffer('RGBA', size, buf, 'raw', 'RGBA', 0, 1)
options = cbook.restrict_dict(kwargs, ['quality', 'optimize',
'progressive'])
- return image.save(filename_or_obj, **options)
+ return image.save(filename_or_obj, format='jpeg', **options)
print_jpeg = print_jpg
filetypes['tif'] = filetypes['tiff'] = 'Tagged Image File Format'
@@ -1893,7 +1893,7 @@ def print_tif(self, filename_or_obj, *args, **kwargs):
buf, size = agg.print_to_buffer()
if kwargs.pop("dryrun", False): return
image = Image.frombuffer('RGBA', size, buf, 'raw', 'RGBA', 0, 1)
- return image.save(filename_or_obj)
+ return image.save(filename_or_obj, format='tiff')
print_tiff = print_tif
def get_supported_filetypes(self):
Something went wrong with that request. Please try again.