mirror of
				https://github.com/python-pillow/Pillow.git
				synced 2025-11-04 09:57:43 +03:00 
			
		
		
		
	Fixed various typos
This commit is contained in:
		
							parent
							
								
									caa8d9c674
								
							
						
					
					
						commit
						a996033079
					
				| 
						 | 
					@ -1810,7 +1810,7 @@ class Image(object):
 | 
				
			||||||
        self.readonly = 0
 | 
					        self.readonly = 0
 | 
				
			||||||
        self.pyaccess = None
 | 
					        self.pyaccess = None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # FIXME: the different tranform methods need further explanation
 | 
					    # FIXME: the different transform methods need further explanation
 | 
				
			||||||
    # instead of bloating the method docs, add a separate chapter.
 | 
					    # instead of bloating the method docs, add a separate chapter.
 | 
				
			||||||
    def transform(self, size, method, data=None, resample=NEAREST, fill=1):
 | 
					    def transform(self, size, method, data=None, resample=NEAREST, fill=1):
 | 
				
			||||||
        """
 | 
					        """
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -64,7 +64,7 @@ pyCMS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        0.0.2 alpha     Jan 6, 2002
 | 
					        0.0.2 alpha     Jan 6, 2002
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                        Added try/except statements arount type() checks of
 | 
					                        Added try/except statements around type() checks of
 | 
				
			||||||
                        potential CObjects... Python won't let you use type()
 | 
					                        potential CObjects... Python won't let you use type()
 | 
				
			||||||
                        on them, and raises a TypeError (stupid, if you ask
 | 
					                        on them, and raises a TypeError (stupid, if you ask
 | 
				
			||||||
                        me!)
 | 
					                        me!)
 | 
				
			||||||
| 
						 | 
					@ -123,8 +123,8 @@ FLAGS = {
 | 
				
			||||||
    "NOTCACHE": 64,  # Inhibit 1-pixel cache
 | 
					    "NOTCACHE": 64,  # Inhibit 1-pixel cache
 | 
				
			||||||
    "NOTPRECALC": 256,
 | 
					    "NOTPRECALC": 256,
 | 
				
			||||||
    "NULLTRANSFORM": 512,  # Don't transform anyway
 | 
					    "NULLTRANSFORM": 512,  # Don't transform anyway
 | 
				
			||||||
    "HIGHRESPRECALC": 1024,  # Use more memory to give better accurancy
 | 
					    "HIGHRESPRECALC": 1024,  # Use more memory to give better accuracy
 | 
				
			||||||
    "LOWRESPRECALC": 2048,  # Use less memory to minimize resouces
 | 
					    "LOWRESPRECALC": 2048,  # Use less memory to minimize resources
 | 
				
			||||||
    "WHITEBLACKCOMPENSATION": 8192,
 | 
					    "WHITEBLACKCOMPENSATION": 8192,
 | 
				
			||||||
    "BLACKPOINTCOMPENSATION": 8192,
 | 
					    "BLACKPOINTCOMPENSATION": 8192,
 | 
				
			||||||
    "GAMUTCHECK": 4096,  # Out of Gamut alarm
 | 
					    "GAMUTCHECK": 4096,  # Out of Gamut alarm
 | 
				
			||||||
| 
						 | 
					@ -573,7 +573,7 @@ def applyTransform(im, transform, inPlace=0):
 | 
				
			||||||
    This function applies a pre-calculated transform (from
 | 
					    This function applies a pre-calculated transform (from
 | 
				
			||||||
    ImageCms.buildTransform() or ImageCms.buildTransformFromOpenProfiles())
 | 
					    ImageCms.buildTransform() or ImageCms.buildTransformFromOpenProfiles())
 | 
				
			||||||
    to an image.  The transform can be used for multiple images, saving
 | 
					    to an image.  The transform can be used for multiple images, saving
 | 
				
			||||||
    considerable calcuation time if doing the same conversion multiple times.
 | 
					    considerable calculation time if doing the same conversion multiple times.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    If you want to modify im in-place instead of receiving a new image as
 | 
					    If you want to modify im in-place instead of receiving a new image as
 | 
				
			||||||
    the return value, set inPlace to TRUE.  This can only be done if
 | 
					    the return value, set inPlace to TRUE.  This can only be done if
 | 
				
			||||||
| 
						 | 
					@ -858,7 +858,7 @@ def getDefaultIntent(profile):
 | 
				
			||||||
    If an error occurs while trying to obtain the default intent, a
 | 
					    If an error occurs while trying to obtain the default intent, a
 | 
				
			||||||
    PyCMSError is raised.
 | 
					    PyCMSError is raised.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Use this function to determine the default (and usually best optomized)
 | 
					    Use this function to determine the default (and usually best optimized)
 | 
				
			||||||
    rendering intent for this profile.  Most profiles support multiple
 | 
					    rendering intent for this profile.  Most profiles support multiple
 | 
				
			||||||
    rendering intents, but are intended mostly for one type of conversion.
 | 
					    rendering intents, but are intended mostly for one type of conversion.
 | 
				
			||||||
    If you wish to use a different intent than returned, use
 | 
					    If you wish to use a different intent than returned, use
 | 
				
			||||||
| 
						 | 
					@ -914,7 +914,7 @@ def isIntentSupported(profile, intent, direction):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        see the pyCMS documentation for details on rendering intents and what
 | 
					        see the pyCMS documentation for details on rendering intents and what
 | 
				
			||||||
            they do.
 | 
					            they do.
 | 
				
			||||||
    :param direction: Integer specifing if the profile is to be used for input,
 | 
					    :param direction: Integer specifying if the profile is to be used for input,
 | 
				
			||||||
        output, or proof
 | 
					        output, or proof
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            INPUT  = 0 (or use ImageCms.DIRECTION_INPUT)
 | 
					            INPUT  = 0 (or use ImageCms.DIRECTION_INPUT)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -4,7 +4,7 @@
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# JPEG (JFIF) file handling
 | 
					# JPEG (JFIF) file handling
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# See "Digital Compression and Coding of Continous-Tone Still Images,
 | 
					# See "Digital Compression and Coding of Continuous-Tone Still Images,
 | 
				
			||||||
# Part 1, Requirements and Guidelines" (CCITT T.81 / ISO 10918-1)
 | 
					# Part 1, Requirements and Guidelines" (CCITT T.81 / ISO 10918-1)
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# History:
 | 
					# History:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -294,7 +294,7 @@ class ImageFileDirectory(collections.MutableMapping):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def named(self):
 | 
					    def named(self):
 | 
				
			||||||
        """
 | 
					        """
 | 
				
			||||||
        Returns the complete tag dictionary, with named tags where posible.
 | 
					        Returns the complete tag dictionary, with named tags where possible.
 | 
				
			||||||
        """
 | 
					        """
 | 
				
			||||||
        from PIL import TiffTags
 | 
					        from PIL import TiffTags
 | 
				
			||||||
        result = {}
 | 
					        result = {}
 | 
				
			||||||
| 
						 | 
					@ -749,7 +749,7 @@ class TiffImageFile(ImageFile.ImageFile):
 | 
				
			||||||
            #
 | 
					            #
 | 
				
			||||||
            # Rearranging for supporting byteio items, since they have a fileno
 | 
					            # Rearranging for supporting byteio items, since they have a fileno
 | 
				
			||||||
            # that returns an IOError if there's no underlying fp. Easier to
 | 
					            # that returns an IOError if there's no underlying fp. Easier to
 | 
				
			||||||
            # dea. with here by reordering.
 | 
					            # deal with here by reordering.
 | 
				
			||||||
            if Image.DEBUG:
 | 
					            if Image.DEBUG:
 | 
				
			||||||
                print("have getvalue. just sending in a string from getvalue")
 | 
					                print("have getvalue. just sending in a string from getvalue")
 | 
				
			||||||
            n, err = decoder.decode(self.fp.getvalue())
 | 
					            n, err = decoder.decode(self.fp.getvalue())
 | 
				
			||||||
| 
						 | 
					@ -985,7 +985,7 @@ class TiffImageFile(ImageFile.ImageFile):
 | 
				
			||||||
# Write TIFF files
 | 
					# Write TIFF files
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# little endian is default except for image modes with
 | 
					# little endian is default except for image modes with
 | 
				
			||||||
# explict big endian byte-order
 | 
					# explicit big endian byte-order
 | 
				
			||||||
 | 
					
 | 
				
			||||||
SAVE_INFO = {
 | 
					SAVE_INFO = {
 | 
				
			||||||
    # mode => rawmode, byteorder, photometrics,
 | 
					    # mode => rawmode, byteorder, photometrics,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -54,7 +54,7 @@ class TestImagingCoreResize(PillowTestCase):
 | 
				
			||||||
        # Make an image with one colored pixel, in one channel.
 | 
					        # Make an image with one colored pixel, in one channel.
 | 
				
			||||||
        # When resized, that channel should be the same as a GS image.
 | 
					        # When resized, that channel should be the same as a GS image.
 | 
				
			||||||
        # Other channels should be unaffected.
 | 
					        # Other channels should be unaffected.
 | 
				
			||||||
        # The R and A channels should not swap, which is indicitive of
 | 
					        # The R and A channels should not swap, which is indicative of
 | 
				
			||||||
        # an endianness issues.
 | 
					        # an endianness issues.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        samples = {
 | 
					        samples = {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -300,32 +300,32 @@ class TestImageDraw(PillowTestCase):
 | 
				
			||||||
        img, draw = self.create_base_image_draw((20, 20))
 | 
					        img, draw = self.create_base_image_draw((20, 20))
 | 
				
			||||||
        draw.line((5, 5, 14, 5), BLACK, 2)
 | 
					        draw.line((5, 5, 14, 5), BLACK, 2)
 | 
				
			||||||
        self.assert_image_equal(
 | 
					        self.assert_image_equal(
 | 
				
			||||||
            img, expected, 'line straigth horizontal normal 2px wide failed')
 | 
					            img, expected, 'line straight horizontal normal 2px wide failed')
 | 
				
			||||||
        expected = Image.open(os.path.join(IMAGES_PATH,
 | 
					        expected = Image.open(os.path.join(IMAGES_PATH,
 | 
				
			||||||
                              'line_horizontal_w2px_inverted.png'))
 | 
					                              'line_horizontal_w2px_inverted.png'))
 | 
				
			||||||
        expected.load()
 | 
					        expected.load()
 | 
				
			||||||
        img, draw = self.create_base_image_draw((20, 20))
 | 
					        img, draw = self.create_base_image_draw((20, 20))
 | 
				
			||||||
        draw.line((14, 5, 5, 5), BLACK, 2)
 | 
					        draw.line((14, 5, 5, 5), BLACK, 2)
 | 
				
			||||||
        self.assert_image_equal(
 | 
					        self.assert_image_equal(
 | 
				
			||||||
            img, expected, 'line straigth horizontal inverted 2px wide failed')
 | 
					            img, expected, 'line straight horizontal inverted 2px wide failed')
 | 
				
			||||||
        expected = Image.open(os.path.join(IMAGES_PATH,
 | 
					        expected = Image.open(os.path.join(IMAGES_PATH,
 | 
				
			||||||
                              'line_horizontal_w3px.png'))
 | 
					                              'line_horizontal_w3px.png'))
 | 
				
			||||||
        expected.load()
 | 
					        expected.load()
 | 
				
			||||||
        img, draw = self.create_base_image_draw((20, 20))
 | 
					        img, draw = self.create_base_image_draw((20, 20))
 | 
				
			||||||
        draw.line((5, 5, 14, 5), BLACK, 3)
 | 
					        draw.line((5, 5, 14, 5), BLACK, 3)
 | 
				
			||||||
        self.assert_image_equal(
 | 
					        self.assert_image_equal(
 | 
				
			||||||
            img, expected, 'line straigth horizontal normal 3px wide failed')
 | 
					            img, expected, 'line straight horizontal normal 3px wide failed')
 | 
				
			||||||
        img, draw = self.create_base_image_draw((20, 20))
 | 
					        img, draw = self.create_base_image_draw((20, 20))
 | 
				
			||||||
        draw.line((14, 5, 5, 5), BLACK, 3)
 | 
					        draw.line((14, 5, 5, 5), BLACK, 3)
 | 
				
			||||||
        self.assert_image_equal(
 | 
					        self.assert_image_equal(
 | 
				
			||||||
            img, expected, 'line straigth horizontal inverted 3px wide failed')
 | 
					            img, expected, 'line straight horizontal inverted 3px wide failed')
 | 
				
			||||||
        expected = Image.open(os.path.join(IMAGES_PATH,
 | 
					        expected = Image.open(os.path.join(IMAGES_PATH,
 | 
				
			||||||
                              'line_horizontal_w101px.png'))
 | 
					                              'line_horizontal_w101px.png'))
 | 
				
			||||||
        expected.load()
 | 
					        expected.load()
 | 
				
			||||||
        img, draw = self.create_base_image_draw((200, 110))
 | 
					        img, draw = self.create_base_image_draw((200, 110))
 | 
				
			||||||
        draw.line((5, 55, 195, 55), BLACK, 101)
 | 
					        draw.line((5, 55, 195, 55), BLACK, 101)
 | 
				
			||||||
        self.assert_image_equal(
 | 
					        self.assert_image_equal(
 | 
				
			||||||
            img, expected, 'line straigth horizontal 101px wide failed')
 | 
					            img, expected, 'line straight horizontal 101px wide failed')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def test_line_h_s1_w2(self):
 | 
					    def test_line_h_s1_w2(self):
 | 
				
			||||||
        self.skipTest('failing')
 | 
					        self.skipTest('failing')
 | 
				
			||||||
| 
						 | 
					@ -344,32 +344,32 @@ class TestImageDraw(PillowTestCase):
 | 
				
			||||||
        img, draw = self.create_base_image_draw((20, 20))
 | 
					        img, draw = self.create_base_image_draw((20, 20))
 | 
				
			||||||
        draw.line((5, 5, 5, 14), BLACK, 2)
 | 
					        draw.line((5, 5, 5, 14), BLACK, 2)
 | 
				
			||||||
        self.assert_image_equal(
 | 
					        self.assert_image_equal(
 | 
				
			||||||
            img, expected, 'line straigth vertical normal 2px wide failed')
 | 
					            img, expected, 'line straight vertical normal 2px wide failed')
 | 
				
			||||||
        expected = Image.open(os.path.join(IMAGES_PATH,
 | 
					        expected = Image.open(os.path.join(IMAGES_PATH,
 | 
				
			||||||
                              'line_vertical_w2px_inverted.png'))
 | 
					                              'line_vertical_w2px_inverted.png'))
 | 
				
			||||||
        expected.load()
 | 
					        expected.load()
 | 
				
			||||||
        img, draw = self.create_base_image_draw((20, 20))
 | 
					        img, draw = self.create_base_image_draw((20, 20))
 | 
				
			||||||
        draw.line((5, 14, 5, 5), BLACK, 2)
 | 
					        draw.line((5, 14, 5, 5), BLACK, 2)
 | 
				
			||||||
        self.assert_image_equal(
 | 
					        self.assert_image_equal(
 | 
				
			||||||
            img, expected, 'line straigth vertical inverted 2px wide failed')
 | 
					            img, expected, 'line straight vertical inverted 2px wide failed')
 | 
				
			||||||
        expected = Image.open(os.path.join(IMAGES_PATH,
 | 
					        expected = Image.open(os.path.join(IMAGES_PATH,
 | 
				
			||||||
                              'line_vertical_w3px.png'))
 | 
					                              'line_vertical_w3px.png'))
 | 
				
			||||||
        expected.load()
 | 
					        expected.load()
 | 
				
			||||||
        img, draw = self.create_base_image_draw((20, 20))
 | 
					        img, draw = self.create_base_image_draw((20, 20))
 | 
				
			||||||
        draw.line((5, 5, 5, 14), BLACK, 3)
 | 
					        draw.line((5, 5, 5, 14), BLACK, 3)
 | 
				
			||||||
        self.assert_image_equal(
 | 
					        self.assert_image_equal(
 | 
				
			||||||
            img, expected, 'line straigth vertical normal 3px wide failed')
 | 
					            img, expected, 'line straight vertical normal 3px wide failed')
 | 
				
			||||||
        img, draw = self.create_base_image_draw((20, 20))
 | 
					        img, draw = self.create_base_image_draw((20, 20))
 | 
				
			||||||
        draw.line((5, 14, 5, 5), BLACK, 3)
 | 
					        draw.line((5, 14, 5, 5), BLACK, 3)
 | 
				
			||||||
        self.assert_image_equal(
 | 
					        self.assert_image_equal(
 | 
				
			||||||
            img, expected, 'line straigth vertical inverted 3px wide failed')
 | 
					            img, expected, 'line straight vertical inverted 3px wide failed')
 | 
				
			||||||
        expected = Image.open(os.path.join(IMAGES_PATH,
 | 
					        expected = Image.open(os.path.join(IMAGES_PATH,
 | 
				
			||||||
                              'line_vertical_w101px.png'))
 | 
					                              'line_vertical_w101px.png'))
 | 
				
			||||||
        expected.load()
 | 
					        expected.load()
 | 
				
			||||||
        img, draw = self.create_base_image_draw((110, 200))
 | 
					        img, draw = self.create_base_image_draw((110, 200))
 | 
				
			||||||
        draw.line((55, 5, 55, 195), BLACK, 101)
 | 
					        draw.line((55, 5, 55, 195), BLACK, 101)
 | 
				
			||||||
        self.assert_image_equal(img, expected,
 | 
					        self.assert_image_equal(img, expected,
 | 
				
			||||||
                                'line straigth vertical 101px wide failed')
 | 
					                                'line straight vertical 101px wide failed')
 | 
				
			||||||
        expected = Image.open(os.path.join(IMAGES_PATH,
 | 
					        expected = Image.open(os.path.join(IMAGES_PATH,
 | 
				
			||||||
                              'line_vertical_slope1px_w2px.png'))
 | 
					                              'line_vertical_slope1px_w2px.png'))
 | 
				
			||||||
        expected.load()
 | 
					        expected.load()
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user