| 66 | } |
| 67 | |
| 68 | bool CCommunityIcons::LoadFile(const char *pPath, int DirType, CImageInfo &Info, CImageInfo &InfoGrayscale, SHA256_DIGEST &Sha256) |
| 69 | { |
| 70 | if(!Graphics()->LoadPng(Info, pPath, DirType)) |
| 71 | { |
| 72 | log_error("menus/browser", "Failed to load community icon from '%s'", pPath); |
| 73 | return false; |
| 74 | } |
| 75 | if(Info.m_Format != CImageInfo::FORMAT_RGBA) |
| 76 | { |
| 77 | Info.Free(); |
| 78 | log_error("menus/browser", "Failed to load community icon from '%s': must be an RGBA image", pPath); |
| 79 | return false; |
| 80 | } |
| 81 | if(!Storage()->CalculateHashes(pPath, DirType, &Sha256)) |
| 82 | { |
| 83 | Info.Free(); |
| 84 | log_error("menus/browser", "Failed to load community icon from '%s': could not calculate hash", pPath); |
| 85 | return false; |
| 86 | } |
| 87 | InfoGrayscale = Info.DeepCopy(); |
| 88 | ConvertToGrayscale(InfoGrayscale); |
| 89 | return true; |
| 90 | } |
| 91 | |
| 92 | void CCommunityIcons::LoadFinish(const char *pCommunityId, CImageInfo &Info, CImageInfo &InfoGrayscale, const SHA256_DIGEST &Sha256) |
| 93 | { |
no test coverage detected