mirror of
				https://github.com/python-pillow/Pillow.git
				synced 2025-11-04 01:47:47 +03:00 
			
		
		
		
	
						commit
						0d0a4e4ebe
					
				| 
						 | 
					@ -670,6 +670,5 @@ class TestFileLibTiff(LibTiffTestCase):
 | 
				
			||||||
        self.assert_image_similar_tofile(im, "Tests/images/flower.jpg", 0.5)
 | 
					        self.assert_image_similar_tofile(im, "Tests/images/flower.jpg", 0.5)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
if __name__ == '__main__':
 | 
					if __name__ == '__main__':
 | 
				
			||||||
    unittest.main()
 | 
					    unittest.main()
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -425,21 +425,24 @@ class TestFileTiff(PillowTestCase):
 | 
				
			||||||
        infile = "Tests/images/tiff_strip_raw.tif"
 | 
					        infile = "Tests/images/tiff_strip_raw.tif"
 | 
				
			||||||
        im = Image.open(infile)
 | 
					        im = Image.open(infile)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        self.assert_image_equal_tofile(im, "Tests/images/tiff_adobe_deflate.png")
 | 
					        self.assert_image_equal_tofile(im,
 | 
				
			||||||
 | 
					                                       "Tests/images/tiff_adobe_deflate.png")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def test_strip_planar_raw(self):
 | 
					    def test_strip_planar_raw(self):
 | 
				
			||||||
        # gdal_translate -of GTiff -co INTERLEAVE=BAND tiff_strip_raw.tif tiff_strip_planar_raw.tiff
 | 
					        # gdal_translate -of GTiff -co INTERLEAVE=BAND tiff_strip_raw.tif tiff_strip_planar_raw.tiff
 | 
				
			||||||
        infile = "Tests/images/tiff_strip_planar_raw.tif"
 | 
					        infile = "Tests/images/tiff_strip_planar_raw.tif"
 | 
				
			||||||
        im = Image.open(infile)
 | 
					        im = Image.open(infile)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        self.assert_image_equal_tofile(im, "Tests/images/tiff_adobe_deflate.png")
 | 
					        self.assert_image_equal_tofile(im,
 | 
				
			||||||
 | 
					                                       "Tests/images/tiff_adobe_deflate.png")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def test_strip_planar_raw_with_overviews(self):
 | 
					    def test_strip_planar_raw_with_overviews(self):
 | 
				
			||||||
        # gdaladdo tiff_strip_planar_raw2.tif 2 4 8 16
 | 
					        # gdaladdo tiff_strip_planar_raw2.tif 2 4 8 16
 | 
				
			||||||
        infile = "Tests/images/tiff_strip_planar_raw_with_overviews.tif"
 | 
					        infile = "Tests/images/tiff_strip_planar_raw_with_overviews.tif"
 | 
				
			||||||
        im = Image.open(infile)
 | 
					        im = Image.open(infile)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        self.assert_image_equal_tofile(im, "Tests/images/tiff_adobe_deflate.png")
 | 
					        self.assert_image_equal_tofile(im,
 | 
				
			||||||
 | 
					                                       "Tests/images/tiff_adobe_deflate.png")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def test_tiled_planar_raw(self):
 | 
					    def test_tiled_planar_raw(self):
 | 
				
			||||||
        # gdal_translate -of GTiff -co TILED=YES -co BLOCKXSIZE=32 -co BLOCKYSIZE=32 -co INTERLEAVE=BAND \
 | 
					        # gdal_translate -of GTiff -co TILED=YES -co BLOCKXSIZE=32 -co BLOCKYSIZE=32 -co INTERLEAVE=BAND \
 | 
				
			||||||
| 
						 | 
					@ -447,7 +450,8 @@ class TestFileTiff(PillowTestCase):
 | 
				
			||||||
        infile = "Tests/images/tiff_tiled_planar_raw.tif"
 | 
					        infile = "Tests/images/tiff_tiled_planar_raw.tif"
 | 
				
			||||||
        im = Image.open(infile)
 | 
					        im = Image.open(infile)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        self.assert_image_equal_tofile(im, "Tests/images/tiff_adobe_deflate.png")
 | 
					        self.assert_image_equal_tofile(im,
 | 
				
			||||||
 | 
					                                       "Tests/images/tiff_adobe_deflate.png")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def test_tiff_save_all(self):
 | 
					    def test_tiff_save_all(self):
 | 
				
			||||||
        import io
 | 
					        import io
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -22,7 +22,6 @@ class TestUnsupportedWebp(PillowTestCase):
 | 
				
			||||||
            WebPImagePlugin.SUPPORTED = True
 | 
					            WebPImagePlugin.SUPPORTED = True
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
@unittest.skipIf(not HAVE_WEBP, "WebP support not installed")
 | 
					@unittest.skipIf(not HAVE_WEBP, "WebP support not installed")
 | 
				
			||||||
class TestFileWebp(PillowTestCase):
 | 
					class TestFileWebp(PillowTestCase):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -20,7 +20,14 @@ has the following structure:
 | 
				
			||||||
{format_directory}
 | 
					{format_directory}
 | 
				
			||||||
{data}
 | 
					{data}
 | 
				
			||||||
Where:
 | 
					Where:
 | 
				
			||||||
{header} = { u32:magic, u32:version, u32:width, u32:height, u32:mipmap_count, u32:format_count }
 | 
					{header} = {
 | 
				
			||||||
 | 
					    u32:magic,
 | 
				
			||||||
 | 
					    u32:version,
 | 
				
			||||||
 | 
					    u32:width,
 | 
				
			||||||
 | 
					    u32:height,
 | 
				
			||||||
 | 
					    u32:mipmap_count,
 | 
				
			||||||
 | 
					    u32:format_count
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
* The "magic" number is "FTEX".
 | 
					* The "magic" number is "FTEX".
 | 
				
			||||||
* "width" and "height" are the dimensions of the texture.
 | 
					* "width" and "height" are the dimensions of the texture.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -284,7 +284,7 @@ class IcnsImageFile(ImageFile.ImageFile):
 | 
				
			||||||
        if info_size not in self.info['sizes'] and len(info_size) == 3 and \
 | 
					        if info_size not in self.info['sizes'] and len(info_size) == 3 and \
 | 
				
			||||||
           info_size[2] == 1:
 | 
					           info_size[2] == 1:
 | 
				
			||||||
            simple_sizes = [(size[0] * size[2], size[1] * size[2])
 | 
					            simple_sizes = [(size[0] * size[2], size[1] * size[2])
 | 
				
			||||||
                           for size in self.info['sizes']]
 | 
					                            for size in self.info['sizes']]
 | 
				
			||||||
            if value in simple_sizes:
 | 
					            if value in simple_sizes:
 | 
				
			||||||
                info_size = self.info['sizes'][simple_sizes.index(value)]
 | 
					                info_size = self.info['sizes'][simple_sizes.index(value)]
 | 
				
			||||||
        if info_size not in self.info['sizes']:
 | 
					        if info_size not in self.info['sizes']:
 | 
				
			||||||
| 
						 | 
					@ -333,6 +333,7 @@ def _save(im, fp, filename):
 | 
				
			||||||
    provided_images = {im.width: im
 | 
					    provided_images = {im.width: im
 | 
				
			||||||
                       for im in im.encoderinfo.get("append_images", [])}
 | 
					                       for im in im.encoderinfo.get("append_images", [])}
 | 
				
			||||||
    last_w = None
 | 
					    last_w = None
 | 
				
			||||||
 | 
					    second_path = None
 | 
				
			||||||
    for w in [16, 32, 128, 256, 512]:
 | 
					    for w in [16, 32, 128, 256, 512]:
 | 
				
			||||||
        prefix = 'icon_{}x{}'.format(w, w)
 | 
					        prefix = 'icon_{}x{}'.format(w, w)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1047,7 +1047,8 @@ class Image(object):
 | 
				
			||||||
                       2 = fast octree
 | 
					                       2 = fast octree
 | 
				
			||||||
                       3 = libimagequant
 | 
					                       3 = libimagequant
 | 
				
			||||||
        :param kmeans: Integer
 | 
					        :param kmeans: Integer
 | 
				
			||||||
        :param palette: Quantize to the palette of given :py:class:`PIL.Image.Image`.
 | 
					        :param palette: Quantize to the palette of given
 | 
				
			||||||
 | 
					                        :py:class:`PIL.Image.Image`.
 | 
				
			||||||
        :returns: A new image
 | 
					        :returns: A new image
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        """
 | 
					        """
 | 
				
			||||||
| 
						 | 
					@ -1773,11 +1774,10 @@ class Image(object):
 | 
				
			||||||
        if self.mode in ("1", "P"):
 | 
					        if self.mode in ("1", "P"):
 | 
				
			||||||
            resample = NEAREST
 | 
					            resample = NEAREST
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if self.mode == 'LA':
 | 
					        if self.mode in ['LA', 'RGBA']:
 | 
				
			||||||
            return self.convert('La').resize(size, resample, box).convert('LA')
 | 
					            im = self.convert(self.mode[:-1]+'a')
 | 
				
			||||||
 | 
					            im = im.resize(size, resample, box)
 | 
				
			||||||
        if self.mode == 'RGBA':
 | 
					            return im.convert(self.mode)
 | 
				
			||||||
            return self.convert('RGBa').resize(size, resample, box).convert('RGBA')
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        self.load()
 | 
					        self.load()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1849,7 +1849,8 @@ class Image(object):
 | 
				
			||||||
        else:
 | 
					        else:
 | 
				
			||||||
            post_trans = translate
 | 
					            post_trans = translate
 | 
				
			||||||
        if center is None:
 | 
					        if center is None:
 | 
				
			||||||
            rotn_center = (w / 2.0, h / 2.0)  # FIXME These should be rounded to ints?
 | 
					            # FIXME These should be rounded to ints?
 | 
				
			||||||
 | 
					            rotn_center = (w / 2.0, h / 2.0)
 | 
				
			||||||
        else:
 | 
					        else:
 | 
				
			||||||
            rotn_center = center
 | 
					            rotn_center = center
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1864,7 +1865,8 @@ class Image(object):
 | 
				
			||||||
            return a*x + b*y + c, d*x + e*y + f
 | 
					            return a*x + b*y + c, d*x + e*y + f
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        matrix[2], matrix[5] = transform(-rotn_center[0] - post_trans[0],
 | 
					        matrix[2], matrix[5] = transform(-rotn_center[0] - post_trans[0],
 | 
				
			||||||
                                         -rotn_center[1] - post_trans[1], matrix)
 | 
					                                         -rotn_center[1] - post_trans[1],
 | 
				
			||||||
 | 
					                                         matrix)
 | 
				
			||||||
        matrix[2] += rotn_center[0]
 | 
					        matrix[2] += rotn_center[0]
 | 
				
			||||||
        matrix[5] += rotn_center[1]
 | 
					        matrix[5] += rotn_center[1]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1887,7 +1889,8 @@ class Image(object):
 | 
				
			||||||
                                             matrix)
 | 
					                                             matrix)
 | 
				
			||||||
            w, h = nw, nh
 | 
					            w, h = nw, nh
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return self.transform((w, h), AFFINE, matrix, resample, fillcolor=fillcolor)
 | 
					        return self.transform((w, h), AFFINE, matrix, resample,
 | 
				
			||||||
 | 
					                              fillcolor=fillcolor)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def save(self, fp, format=None, **params):
 | 
					    def save(self, fp, format=None, **params):
 | 
				
			||||||
        """
 | 
					        """
 | 
				
			||||||
| 
						 | 
					@ -2154,8 +2157,8 @@ class Image(object):
 | 
				
			||||||
        :param fill: If **method** is an
 | 
					        :param fill: If **method** is an
 | 
				
			||||||
          :py:class:`~PIL.Image.ImageTransformHandler` object, this is one of
 | 
					          :py:class:`~PIL.Image.ImageTransformHandler` object, this is one of
 | 
				
			||||||
          the arguments passed to it. Otherwise, it is unused.
 | 
					          the arguments passed to it. Otherwise, it is unused.
 | 
				
			||||||
        :param fillcolor: Optional fill color for the area outside the transform
 | 
					        :param fillcolor: Optional fill color for the area outside the
 | 
				
			||||||
           in the output image.
 | 
					           transform in the output image.
 | 
				
			||||||
        :returns: An :py:class:`~PIL.Image.Image` object.
 | 
					        :returns: An :py:class:`~PIL.Image.Image` object.
 | 
				
			||||||
        """
 | 
					        """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2620,6 +2623,7 @@ def open(fp, mode="r"):
 | 
				
			||||||
    preinit()
 | 
					    preinit()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    accept_warnings = []
 | 
					    accept_warnings = []
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def _open_core(fp, filename, prefix):
 | 
					    def _open_core(fp, filename, prefix):
 | 
				
			||||||
        for i in ID:
 | 
					        for i in ID:
 | 
				
			||||||
            try:
 | 
					            try:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -647,7 +647,7 @@ def createProfile(colorSpace, colorTemp=-1):
 | 
				
			||||||
    if colorSpace == "LAB":
 | 
					    if colorSpace == "LAB":
 | 
				
			||||||
        try:
 | 
					        try:
 | 
				
			||||||
            colorTemp = float(colorTemp)
 | 
					            colorTemp = float(colorTemp)
 | 
				
			||||||
        except:
 | 
					        except (TypeError, ValueError):
 | 
				
			||||||
            raise PyCMSError(
 | 
					            raise PyCMSError(
 | 
				
			||||||
                "Color temperature must be numeric, \"%s\" not valid"
 | 
					                "Color temperature must be numeric, \"%s\" not valid"
 | 
				
			||||||
                % colorTemp)
 | 
					                % colorTemp)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -406,7 +406,9 @@ def floodfill(image, xy, value, border=None, thresh=0):
 | 
				
			||||||
    except (ValueError, IndexError):
 | 
					    except (ValueError, IndexError):
 | 
				
			||||||
        return  # seed point outside image
 | 
					        return  # seed point outside image
 | 
				
			||||||
    edge = {(x, y)}
 | 
					    edge = {(x, y)}
 | 
				
			||||||
    full_edge = set()  # use a set to keep record of current and previous edge pixels to reduce memory consumption
 | 
					    # use a set to keep record of current and previous edge pixels
 | 
				
			||||||
 | 
					    # to reduce memory consumption
 | 
				
			||||||
 | 
					    full_edge = set()
 | 
				
			||||||
    while edge:
 | 
					    while edge:
 | 
				
			||||||
        new_edge = set()
 | 
					        new_edge = set()
 | 
				
			||||||
        for (x, y) in edge:  # 4 adjacent method
 | 
					        for (x, y) in edge:  # 4 adjacent method
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -467,7 +467,7 @@ class Color3DLUT(MultibandFilter):
 | 
				
			||||||
    def __repr__(self):
 | 
					    def __repr__(self):
 | 
				
			||||||
        r = [
 | 
					        r = [
 | 
				
			||||||
            "{} from {}".format(self.__class__.__name__,
 | 
					            "{} from {}".format(self.__class__.__name__,
 | 
				
			||||||
                                  self.table.__class__.__name__),
 | 
					                                self.table.__class__.__name__),
 | 
				
			||||||
            "size={:d}x{:d}x{:d}".format(*self.size),
 | 
					            "size={:d}x{:d}x{:d}".format(*self.size),
 | 
				
			||||||
            "channels={:d}".format(self.channels),
 | 
					            "channels={:d}".format(self.channels),
 | 
				
			||||||
        ]
 | 
					        ]
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -203,7 +203,7 @@ class FreeTypeFont(object):
 | 
				
			||||||
            size=self.size if size is None else size,
 | 
					            size=self.size if size is None else size,
 | 
				
			||||||
            index=self.index if index is None else index,
 | 
					            index=self.index if index is None else index,
 | 
				
			||||||
            encoding=self.encoding if encoding is None else encoding,
 | 
					            encoding=self.encoding if encoding is None else encoding,
 | 
				
			||||||
            layout_engine=self.layout_engine if layout_engine is None else layout_engine
 | 
					            layout_engine=layout_engine or self.layout_engine
 | 
				
			||||||
        )
 | 
					        )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -56,7 +56,7 @@ def grabclipboard():
 | 
				
			||||||
        commands = [
 | 
					        commands = [
 | 
				
			||||||
            "set theFile to (open for access POSIX file \""+filepath+"\" with write permission)",
 | 
					            "set theFile to (open for access POSIX file \""+filepath+"\" with write permission)",
 | 
				
			||||||
            "try",
 | 
					            "try",
 | 
				
			||||||
                "write (the clipboard as JPEG picture) to theFile",
 | 
					            "    write (the clipboard as JPEG picture) to theFile",
 | 
				
			||||||
            "end try",
 | 
					            "end try",
 | 
				
			||||||
            "close access theFile"
 | 
					            "close access theFile"
 | 
				
			||||||
        ]
 | 
					        ]
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -441,7 +441,10 @@ def fit(image, size, method=Image.NEAREST, bleed=0.0, centering=(0.5, 0.5)):
 | 
				
			||||||
    crop_left = bleed_pixels[0] + (live_size[0]-crop_width) * centering[0]
 | 
					    crop_left = bleed_pixels[0] + (live_size[0]-crop_width) * centering[0]
 | 
				
			||||||
    crop_top = bleed_pixels[1] + (live_size[1]-crop_height) * centering[1]
 | 
					    crop_top = bleed_pixels[1] + (live_size[1]-crop_height) * centering[1]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    crop = (crop_left, crop_top, crop_left + crop_width, crop_top + crop_height)
 | 
					    crop = (
 | 
				
			||||||
 | 
					        crop_left, crop_top,
 | 
				
			||||||
 | 
					        crop_left + crop_width, crop_top + crop_height
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # resize the image and return it
 | 
					    # resize the image and return it
 | 
				
			||||||
    return image.resize(size, method, box=crop)
 | 
					    return image.resize(size, method, box=crop)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -185,8 +185,8 @@ if qt_is_installed:
 | 
				
			||||||
            An PIL image wrapper for Qt.  This is a subclass of PyQt's QImage
 | 
					            An PIL image wrapper for Qt.  This is a subclass of PyQt's QImage
 | 
				
			||||||
            class.
 | 
					            class.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            :param im: A PIL Image object, or a file name (given either as Python
 | 
					            :param im: A PIL Image object, or a file name (given either as
 | 
				
			||||||
                string or a PyQt string object).
 | 
					                Python string or a PyQt string object).
 | 
				
			||||||
            """
 | 
					            """
 | 
				
			||||||
            im_data = _toqclass_helper(im)
 | 
					            im_data = _toqclass_helper(im)
 | 
				
			||||||
            # must keep a reference, or Qt will crash!
 | 
					            # must keep a reference, or Qt will crash!
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -32,7 +32,8 @@ def _accept(prefix):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if is_riff_file_format and is_webp_file and is_valid_vp8_mode:
 | 
					    if is_riff_file_format and is_webp_file and is_valid_vp8_mode:
 | 
				
			||||||
        if not SUPPORTED:
 | 
					        if not SUPPORTED:
 | 
				
			||||||
            return "image file could not be identified because WEBP support not installed"
 | 
					            return "image file could not be identified " \
 | 
				
			||||||
 | 
					                   "because WEBP support not installed"
 | 
				
			||||||
        return True
 | 
					        return True
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -253,7 +254,8 @@ def _save_all(im, fp, filename):
 | 
				
			||||||
                rawmode = ims.mode
 | 
					                rawmode = ims.mode
 | 
				
			||||||
                if ims.mode not in _VALID_WEBP_MODES:
 | 
					                if ims.mode not in _VALID_WEBP_MODES:
 | 
				
			||||||
                    alpha = 'A' in ims.mode or 'a' in ims.mode \
 | 
					                    alpha = 'A' in ims.mode or 'a' in ims.mode \
 | 
				
			||||||
                            or (ims.mode == 'P' and 'A' in ims.im.getpalettemode())
 | 
					                            or (ims.mode == 'P' and
 | 
				
			||||||
 | 
					                                'A' in ims.im.getpalettemode())
 | 
				
			||||||
                    rawmode = 'RGBA' if alpha else 'RGB'
 | 
					                    rawmode = 'RGBA' if alpha else 'RGB'
 | 
				
			||||||
                    frame = ims.convert(rawmode)
 | 
					                    frame = ims.convert(rawmode)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -72,6 +72,7 @@ def vc_setup(compiler, bit):
 | 
				
			||||||
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" %s""" % arch
 | 
					call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" %s""" % arch
 | 
				
			||||||
    return script
 | 
					    return script
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def build_one(py_ver, compiler, bit):
 | 
					def build_one(py_ver, compiler, bit):
 | 
				
			||||||
    # UNDONE virtual envs if we're not running on appveyor
 | 
					    # UNDONE virtual envs if we're not running on appveyor
 | 
				
			||||||
    args = {}
 | 
					    args = {}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -3,12 +3,12 @@ import os
 | 
				
			||||||
SF_MIRROR = 'http://iweb.dl.sourceforge.net'
 | 
					SF_MIRROR = 'http://iweb.dl.sourceforge.net'
 | 
				
			||||||
PILLOW_DEPENDS_DIR = 'C:\\pillow-depends\\'
 | 
					PILLOW_DEPENDS_DIR = 'C:\\pillow-depends\\'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
pythons = {'27': {'compiler':7, 'vc':2008},
 | 
					pythons = {'27': {'compiler': 7, 'vc': 2008},
 | 
				
			||||||
           'pypy2': {'compiler':7, 'vc':2008},
 | 
					           'pypy2': {'compiler': 7, 'vc': 2008},
 | 
				
			||||||
           '34': {'compiler':7.1, 'vc':2010},
 | 
					           '34': {'compiler': 7.1, 'vc': 2010},
 | 
				
			||||||
           '35': {'compiler':7.1, 'vc':2015},
 | 
					           '35': {'compiler': 7.1, 'vc': 2015},
 | 
				
			||||||
           '36': {'compiler':7.1, 'vc':2015},
 | 
					           '36': {'compiler': 7.1, 'vc': 2015},
 | 
				
			||||||
           '37': {'compiler':7.1, 'vc':2015}}
 | 
					           '37': {'compiler': 7.1, 'vc': 2015}}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
VIRT_BASE = "c:/vp/"
 | 
					VIRT_BASE = "c:/vp/"
 | 
				
			||||||
X64_EXT = os.environ.get('X64_EXT', "x64")
 | 
					X64_EXT = os.environ.get('X64_EXT', "x64")
 | 
				
			||||||
| 
						 | 
					@ -165,11 +165,13 @@ def compiler_from_env():
 | 
				
			||||||
    bit = bit_from_env()
 | 
					    bit = bit_from_env()
 | 
				
			||||||
    return compilers[py_info['compiler']][py_info['vc']][bit]
 | 
					    return compilers[py_info['compiler']][py_info['vc']][bit]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def bit_from_env():
 | 
					def bit_from_env():
 | 
				
			||||||
    py = os.environ['PYTHON']
 | 
					    py = os.environ['PYTHON']
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return 64 if '64' in py else 32
 | 
					    return 64 if '64' in py else 32
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def all_compilers():
 | 
					def all_compilers():
 | 
				
			||||||
    all = []
 | 
					    all = []
 | 
				
			||||||
    for vc_compilers in compilers.values():
 | 
					    for vc_compilers in compilers.values():
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user