mirror of
				https://github.com/python-pillow/Pillow.git
				synced 2025-11-04 09:57:43 +03:00 
			
		
		
		
	try the ascii version of cmsGetProfileInfo
This commit is contained in:
		
							parent
							
								
									e9e5599412
								
							
						
					
					
						commit
						135c47e82a
					
				| 
						 | 
				
			
			@ -512,18 +512,20 @@ _profile_getattr(CmsProfileObject* self, cmsInfoType field)
 | 
			
		|||
{
 | 
			
		||||
    // UNDONE -- check that I'm getting the right fields on these.
 | 
			
		||||
    // return PyUnicode_DecodeFSDefault(cmsTakeProductName(self->profile));
 | 
			
		||||
    wchar_t buf[256];
 | 
			
		||||
    //wchar_t buf[256]; -- UNDONE need wchar_t for unicode version. 
 | 
			
		||||
    char buf[256];
 | 
			
		||||
    cmsUInt32Number written;
 | 
			
		||||
    written =  cmsGetProfileInfo(self->profile, 
 | 
			
		||||
                                 field,
 | 
			
		||||
                                 "en",
 | 
			
		||||
                                 "us",
 | 
			
		||||
                                 buf,
 | 
			
		||||
                                 256);
 | 
			
		||||
    written =  cmsGetProfileInfoASCII(self->profile, 
 | 
			
		||||
                                      field,
 | 
			
		||||
                                      "en",
 | 
			
		||||
                                      "us",
 | 
			
		||||
                                      buf,
 | 
			
		||||
                                      256);
 | 
			
		||||
    if (written) {
 | 
			
		||||
        return PyUnicode_DecodeFSDefault(buf);
 | 
			
		||||
    }
 | 
			
		||||
    return NULL;
 | 
			
		||||
    // UNDONE suppressing error here by sending back blank string. 
 | 
			
		||||
    return PyUnicode_DecodeFSDefault("");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static PyObject*
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user