mirror of
				https://github.com/python-pillow/Pillow.git
				synced 2025-11-04 01:47:47 +03:00 
			
		
		
		
	ducktype the array_interface obj to see if it provides tobytes or tostring
This commit is contained in:
		
							parent
							
								
									c3d6b05d10
								
							
						
					
					
						commit
						587b9a79d8
					
				| 
						 | 
				
			
			@ -1944,6 +1944,9 @@ def fromarray(obj, mode=None):
 | 
			
		|||
 | 
			
		||||
    size = shape[1], shape[0]
 | 
			
		||||
    if strides is not None:
 | 
			
		||||
        if hasattr(obj, 'tobytes'):
 | 
			
		||||
            obj = obj.tobytes()
 | 
			
		||||
        else:
 | 
			
		||||
            obj = obj.tostring()
 | 
			
		||||
 | 
			
		||||
    return frombuffer(mode, size, obj, "raw", rawmode, 0, 1)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user