mirror of
				https://github.com/python-pillow/Pillow.git
				synced 2025-11-04 09:57:43 +03:00 
			
		
		
		
	Fix RAQM feature detection
This commit is contained in:
		
							parent
							
								
									2528743d8c
								
							
						
					
					
						commit
						42831098ac
					
				| 
						 | 
					@ -4,7 +4,6 @@ modules = {
 | 
				
			||||||
    "pil": "PIL._imaging",
 | 
					    "pil": "PIL._imaging",
 | 
				
			||||||
    "tkinter": "PIL._tkinter_finder",
 | 
					    "tkinter": "PIL._tkinter_finder",
 | 
				
			||||||
    "freetype2": "PIL._imagingft",
 | 
					    "freetype2": "PIL._imagingft",
 | 
				
			||||||
    "raqm": "PIL._imagingft",
 | 
					 | 
				
			||||||
    "littlecms2": "PIL._imagingcms",
 | 
					    "littlecms2": "PIL._imagingcms",
 | 
				
			||||||
    "webp": "PIL._webp",
 | 
					    "webp": "PIL._webp",
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -46,6 +45,7 @@ def get_supported_codecs():
 | 
				
			||||||
features = {
 | 
					features = {
 | 
				
			||||||
    "webp_mux": ("PIL._webp", 'HAVE_WEBPMUX'),
 | 
					    "webp_mux": ("PIL._webp", 'HAVE_WEBPMUX'),
 | 
				
			||||||
    "transp_webp": ("PIL._webp", "HAVE_TRANSPARENCY"),
 | 
					    "transp_webp": ("PIL._webp", "HAVE_TRANSPARENCY"),
 | 
				
			||||||
 | 
					    "raqm": ("PIL._imagingft", "HAVE_RAQM")
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def check_feature(feature):
 | 
					def check_feature(feature):
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -828,7 +828,7 @@ setup_module(PyObject* m) {
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
    v = PyBool_FromLong(0);
 | 
					    v = PyBool_FromLong(0);
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
    PyDict_SetItemString(d, "have_raqm", v);
 | 
					    PyDict_SetItemString(d, "HAVE_RAQM", v);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return 0;
 | 
					    return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -184,7 +184,7 @@ if __name__ == "__main__":
 | 
				
			||||||
        ("jpg_2000", "OPENJPEG (JPEG2000)"),
 | 
					        ("jpg_2000", "OPENJPEG (JPEG2000)"),
 | 
				
			||||||
        ("zlib", "ZLIB (PNG/ZIP)"),
 | 
					        ("zlib", "ZLIB (PNG/ZIP)"),
 | 
				
			||||||
        ("libtiff", "LIBTIFF"),
 | 
					        ("libtiff", "LIBTIFF"),
 | 
				
			||||||
        ("raqm", "RAQM")
 | 
					        ("raqm", "RAQM (Bidirectional Text)")
 | 
				
			||||||
    ]:
 | 
					    ]:
 | 
				
			||||||
        if features.check(name):
 | 
					        if features.check(name):
 | 
				
			||||||
            print("---", feature, "support ok")
 | 
					            print("---", feature, "support ok")
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user