We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Here is a replacement LoadNamedIconHelper() that does't try to add extensions to an icon with a known extension.
/** Helper for loading icons by name. */ IconNode *LoadNamedIconHelper(const char *name, const char *path, char save, char preserveAspect) { IconNode *result; char *temp; const unsigned nameLength = strlen(name); const unsigned pathLength = strlen(path); unsigned i, has_extension = 0; ImageNode *image; temp = AllocateStack(nameLength + pathLength + MAX_EXTENSION_LENGTH + 1); memcpy(&temp[0], path, pathLength); memcpy(&temp[pathLength], name, nameLength+1); result = NULL; size_t templen = pathLength + nameLength; for(i = 1; i < EXTENSION_COUNT; i++){ if (!strcmp(ICON_EXTENSIONS[i],temp+templen-strlen(ICON_EXTENSIONS[i]))){ has_extension = 1; break; } } if (has_extension){ image = LoadImage(temp, 0, 0, 1); }else for(i = 0; i < EXTENSION_COUNT; i++) { const unsigned len = strlen(ICON_EXTENSIONS[i]); memcpy(&temp[templen], ICON_EXTENSIONS[i], len + 1); image = LoadImage(temp, 0, 0, 1); if (image) break; } if (image) { result = CreateIcon(image); result->preserveAspect = preserveAspect; result->name = CopyString(temp); if (save) InsertIcon(result); DestroyImage(image); } ReleaseStack(temp); return result; }
The text was updated successfully, but these errors were encountered:
Don't try other extensions if an extension is already specified (issue …
8f68bee
…#258).
Fixed as of snapshot 1354.
Sorry, something went wrong.
No branches or pull requests
Here is a replacement LoadNamedIconHelper() that does't try to add extensions to an icon with a known extension.
The text was updated successfully, but these errors were encountered: