Thank you for your interest in contributing to MagickWand! This document provides guidelines for contributing to the project.
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/YOUR_USERNAME/magickwand.git cd magickwand - Install dependencies:
npm install
- Build the native module:
npm run install
-
Create a feature branch:
git checkout -b feature/your-feature-name
-
Make your changes following the coding standards below
-
Run tests to ensure nothing breaks:
npm test -
Run linter to check code quality:
npm run lint
-
Commit your changes with clear, descriptive messages:
git commit -m "Add feature: description of what you did"
- Use ES6+ syntax where appropriate
- Follow the ESLint configuration (
eslint.config.js) - Use 2 spaces for indentation
- Use single quotes for strings
- Add JSDoc comments for all public functions
- Follow existing code style
- Keep changes minimal and focused
- Test on both macOS and Linux if possible
- Ensure compatibility with both ImageMagick 6 and 7
- All new features must include tests
- Tests are located in
test/test.js - Use Mocha's
describeanditblocks - Aim for clear, descriptive test names
Example:
it('should resize image maintaining aspect ratio when height is 0', function(done) {
magickwand.resize(imagePath, { width: 100, height: 0 }, function(err, data, info) {
assert(err === undefined);
assert(info.width === 100);
assert(info.height > 0);
done();
});
});- Update documentation if you're changing functionality
- Update CHANGELOG.md with your changes
- Ensure all tests pass (
npm test) - Ensure code quality (
npm run lint) - Create a pull request with a clear title and description:
- What does this PR do?
- Why is this change necessary?
- How has it been tested?
Use conventional commit format:
feat: Add new featurefix: Fix bug descriptiondocs: Update documentationtest: Add tests for Xrefactor: Refactor codechore: Update dependencies
When reporting bugs, please include:
- Node.js version (
node --version) - ImageMagick version (
magick --versionorconvert --version) - Operating system and version
- Minimal code to reproduce the issue
- Error messages and stack traces
- Expected vs actual behavior
When requesting features:
- Explain the use case
- Describe the desired behavior
- Provide examples if possible
- Consider whether it fits the project's scope
- Be respectful and inclusive
- Welcome newcomers
- Focus on constructive feedback
- Accept criticism gracefully
- Prioritize the project's best interests
- Harassment or discrimination
- Trolling or insulting comments
- Publishing others' private information
- Other unprofessional conduct
If you encounter issues with OpenMP:
brew install imagemagick --without-openmpTo build in debug mode:
node-gyp configure --debug
node-gyp buildMagickWand v1.0.0+ is optimized for ImageMagick 7. If you need to test against ImageMagick 6 (legacy support):
# ImageMagick 6 (legacy)
brew install imagemagick@6
brew link imagemagick@6 --force
# ImageMagick 7 (recommended)
brew unlink imagemagick@6
brew install imagemagickIf you have questions that aren't covered here:
- Check existing issues and pull requests
- Open a new issue with the
questionlabel - Be specific about what you're trying to do
By contributing, you agree that your contributions will be licensed under the MIT License.