mirror of
				https://github.com/python-pillow/Pillow.git
				synced 2025-10-31 07:57:27 +03:00 
			
		
		
		
	Removed debugging code
This commit is contained in:
		
							parent
							
								
									3ea5b8c233
								
							
						
					
					
						commit
						f6e4997919
					
				|  | @ -225,15 +225,12 @@ SAVE = { | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| def _save(im, fp, filename, check=0): | def _save(im, fp, filename): | ||||||
|     try: |     try: | ||||||
|         rawmode, bits, colors = SAVE[im.mode] |         rawmode, bits, colors = SAVE[im.mode] | ||||||
|     except KeyError: |     except KeyError: | ||||||
|         raise IOError("cannot write mode %s as BMP" % im.mode) |         raise IOError("cannot write mode %s as BMP" % im.mode) | ||||||
| 
 | 
 | ||||||
|     if check: |  | ||||||
|         return check |  | ||||||
| 
 |  | ||||||
|     info = im.encoderinfo |     info = im.encoderinfo | ||||||
| 
 | 
 | ||||||
|     dpi = info.get("dpi", (96, 96)) |     dpi = info.get("dpi", (96, 96)) | ||||||
|  |  | ||||||
|  | @ -314,7 +314,7 @@ SAVE = { | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| def _save(im, fp, filename, check=0): | def _save(im, fp, filename): | ||||||
| 
 | 
 | ||||||
|     try: |     try: | ||||||
|         image_type, rawmode = SAVE[im.mode] |         image_type, rawmode = SAVE[im.mode] | ||||||
|  | @ -323,9 +323,6 @@ def _save(im, fp, filename, check=0): | ||||||
| 
 | 
 | ||||||
|     frames = im.encoderinfo.get("frames", 1) |     frames = im.encoderinfo.get("frames", 1) | ||||||
| 
 | 
 | ||||||
|     if check: |  | ||||||
|         return check |  | ||||||
| 
 |  | ||||||
|     fp.write(("Image type: %s image\r\n" % image_type).encode('ascii')) |     fp.write(("Image type: %s image\r\n" % image_type).encode('ascii')) | ||||||
|     if filename: |     if filename: | ||||||
|         fp.write(("Name: %s\r\n" % filename).encode('ascii')) |         fp.write(("Name: %s\r\n" % filename).encode('ascii')) | ||||||
|  |  | ||||||
|  | @ -116,7 +116,7 @@ _COMPRESSION_TYPES = { | ||||||
| ## | ## | ||||||
| # (Internal) Image save plugin for the Palm format. | # (Internal) Image save plugin for the Palm format. | ||||||
| 
 | 
 | ||||||
| def _save(im, fp, filename, check=0): | def _save(im, fp, filename): | ||||||
| 
 | 
 | ||||||
|     if im.mode == "P": |     if im.mode == "P": | ||||||
| 
 | 
 | ||||||
|  | @ -165,9 +165,6 @@ def _save(im, fp, filename, check=0): | ||||||
| 
 | 
 | ||||||
|         raise IOError("cannot write mode %s as Palm" % im.mode) |         raise IOError("cannot write mode %s as Palm" % im.mode) | ||||||
| 
 | 
 | ||||||
|     if check: |  | ||||||
|         return check |  | ||||||
| 
 |  | ||||||
|     # |     # | ||||||
|     # make sure image data is available |     # make sure image data is available | ||||||
|     im.load() |     im.load() | ||||||
|  |  | ||||||
|  | @ -119,16 +119,13 @@ SAVE = { | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| def _save(im, fp, filename, check=0): | def _save(im, fp, filename): | ||||||
| 
 | 
 | ||||||
|     try: |     try: | ||||||
|         version, bits, planes, rawmode = SAVE[im.mode] |         version, bits, planes, rawmode = SAVE[im.mode] | ||||||
|     except KeyError: |     except KeyError: | ||||||
|         raise ValueError("Cannot save %s images as PCX" % im.mode) |         raise ValueError("Cannot save %s images as PCX" % im.mode) | ||||||
| 
 | 
 | ||||||
|     if check: |  | ||||||
|         return check |  | ||||||
| 
 |  | ||||||
|     # bytes per plane |     # bytes per plane | ||||||
|     stride = (im.size[0] * bits + 7) // 8 |     stride = (im.size[0] * bits + 7) // 8 | ||||||
|     # stride should be even |     # stride should be even | ||||||
|  |  | ||||||
|  | @ -664,7 +664,7 @@ class _idat(object): | ||||||
|         self.chunk(self.fp, b"IDAT", data) |         self.chunk(self.fp, b"IDAT", data) | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| def _save(im, fp, filename, chunk=putchunk, check=0): | def _save(im, fp, filename, chunk=putchunk): | ||||||
|     # save an image to disk (called by the save method) |     # save an image to disk (called by the save method) | ||||||
| 
 | 
 | ||||||
|     mode = im.mode |     mode = im.mode | ||||||
|  | @ -706,9 +706,6 @@ def _save(im, fp, filename, chunk=putchunk, check=0): | ||||||
|     except KeyError: |     except KeyError: | ||||||
|         raise IOError("cannot write mode %s as PNG" % mode) |         raise IOError("cannot write mode %s as PNG" % mode) | ||||||
| 
 | 
 | ||||||
|     if check: |  | ||||||
|         return check |  | ||||||
| 
 |  | ||||||
|     # |     # | ||||||
|     # write minimal PNG file |     # write minimal PNG file | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user