mirror of
				https://github.com/python-pillow/Pillow.git
				synced 2025-11-04 09:57:43 +03:00 
			
		
		
		
	
						commit
						650062bc75
					
				| 
						 | 
				
			
			@ -156,10 +156,10 @@ class LutBuilder(object):
 | 
			
		|||
#        print '--'
 | 
			
		||||
 | 
			
		||||
        # compile the patterns into regular expressions for speed
 | 
			
		||||
        for i in range(len(patterns)):
 | 
			
		||||
            p = patterns[i][0].replace('.', 'X').replace('X', '[01]')
 | 
			
		||||
        for i, pattern in enumerate(patterns):
 | 
			
		||||
            p = pattern[0].replace('.', 'X').replace('X', '[01]')
 | 
			
		||||
            p = re.compile(p)
 | 
			
		||||
            patterns[i] = (p, patterns[i][1])
 | 
			
		||||
            patterns[i] = (p, pattern[1])
 | 
			
		||||
 | 
			
		||||
        # Step through table and find patterns that match.
 | 
			
		||||
        # Note that all the patterns are searched. The last one
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -80,13 +80,12 @@ _Palm8BitColormapValues = (
 | 
			
		|||
 | 
			
		||||
# so build a prototype image to be used for palette resampling
 | 
			
		||||
def build_prototype_image():
 | 
			
		||||
    image = Image.new("L", (1, len(_Palm8BitColormapValues),))
 | 
			
		||||
    image = Image.new("L", (1, len(_Palm8BitColormapValues)))
 | 
			
		||||
    image.putdata(list(range(len(_Palm8BitColormapValues))))
 | 
			
		||||
    palettedata = ()
 | 
			
		||||
    for i in range(len(_Palm8BitColormapValues)):
 | 
			
		||||
        palettedata = palettedata + _Palm8BitColormapValues[i]
 | 
			
		||||
    for i in range(256 - len(_Palm8BitColormapValues)):
 | 
			
		||||
        palettedata = palettedata + (0, 0, 0)
 | 
			
		||||
    for colormapValue in _Palm8BitColormapValues:
 | 
			
		||||
        palettedata += colormapValue
 | 
			
		||||
    palettedata += (0, 0, 0)*(256 - len(_Palm8BitColormapValues))
 | 
			
		||||
    image.putpalette(palettedata)
 | 
			
		||||
    return image
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1246,12 +1246,12 @@ class TiffImageFile(ImageFile.ImageFile):
 | 
			
		|||
                a = None
 | 
			
		||||
 | 
			
		||||
            else:
 | 
			
		||||
                for i in range(len(offsets)):
 | 
			
		||||
                for i, offset in enumerate(offsets):
 | 
			
		||||
                    a = self._decoder(rawmode, l, i)
 | 
			
		||||
                    self.tile.append(
 | 
			
		||||
                        (self._compression,
 | 
			
		||||
                            (0, min(y, ysize), w, min(y+h, ysize)),
 | 
			
		||||
                            offsets[i], a))
 | 
			
		||||
                            offset, a))
 | 
			
		||||
                    if DEBUG:
 | 
			
		||||
                        print("tiles: ", self.tile)
 | 
			
		||||
                    y = y + h
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user