mirror of
				https://github.com/python-pillow/Pillow.git
				synced 2025-11-04 01:47:47 +03:00 
			
		
		
		
	Merge pull request #7187 from radarhere/putpalette
This commit is contained in:
		
						commit
						c62c514299
					
				| 
						 | 
					@ -32,6 +32,14 @@ def test_putpalette():
 | 
				
			||||||
    with pytest.raises(ValueError):
 | 
					    with pytest.raises(ValueError):
 | 
				
			||||||
        palette("YCbCr")
 | 
					        palette("YCbCr")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    with Image.open("Tests/images/hopper_gray.jpg") as im:
 | 
				
			||||||
 | 
					        assert im.mode == "L"
 | 
				
			||||||
 | 
					        im.putpalette(list(range(256)) * 3)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    with Image.open("Tests/images/la.tga") as im:
 | 
				
			||||||
 | 
					        assert im.mode == "LA"
 | 
				
			||||||
 | 
					        im.putpalette(list(range(256)) * 3)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def test_imagepalette():
 | 
					def test_imagepalette():
 | 
				
			||||||
    im = hopper("P")
 | 
					    im = hopper("P")
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1552,10 +1552,12 @@ static struct {
 | 
				
			||||||
    {"P", "P;4L", 4, unpackP4L},
 | 
					    {"P", "P;4L", 4, unpackP4L},
 | 
				
			||||||
    {"P", "P", 8, copy1},
 | 
					    {"P", "P", 8, copy1},
 | 
				
			||||||
    {"P", "P;R", 8, unpackLR},
 | 
					    {"P", "P;R", 8, unpackLR},
 | 
				
			||||||
 | 
					    {"P", "L", 8, copy1},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /* palette w. alpha */
 | 
					    /* palette w. alpha */
 | 
				
			||||||
    {"PA", "PA", 16, unpackLA},
 | 
					    {"PA", "PA", 16, unpackLA},
 | 
				
			||||||
    {"PA", "PA;L", 16, unpackLAL},
 | 
					    {"PA", "PA;L", 16, unpackLAL},
 | 
				
			||||||
 | 
					    {"PA", "LA", 16, unpackLA},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /* true colour */
 | 
					    /* true colour */
 | 
				
			||||||
    {"RGB", "RGB", 24, ImagingUnpackRGB},
 | 
					    {"RGB", "RGB", 24, ImagingUnpackRGB},
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user