{"id":31286911,"url":"https://github.com/jelius-sama/convert_cbz","last_synced_at":"2025-09-24T10:54:17.694Z","repository":{"id":315911662,"uuid":"1061229952","full_name":"jelius-sama/convert_cbz","owner":"jelius-sama","description":"A high-performance, concurrent tool for converting folders containing images into CBZ (Comic Book Archive) files. Built in Go for speed and reliability.","archived":false,"fork":false,"pushed_at":"2025-09-21T14:12:01.000Z","size":8,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-21T16:14:41.353Z","etag":null,"topics":["blazingly-fast","cbz","cbz-conver","cli","cli-app","comic","concurrent","convert","converter","cross-platform","doujinshi","go","golang","manga","unix"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jelius-sama.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-21T14:03:16.000Z","updated_at":"2025-09-21T14:06:48.000Z","dependencies_parsed_at":"2025-09-21T16:14:46.934Z","dependency_job_id":"9320f917-19f5-42e0-bdf0-7b1a2fd1bec5","html_url":"https://github.com/jelius-sama/convert_cbz","commit_stats":null,"previous_names":["jelius-sama/convert_cbz"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/jelius-sama/convert_cbz","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jelius-sama%2Fconvert_cbz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jelius-sama%2Fconvert_cbz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jelius-sama%2Fconvert_cbz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jelius-sama%2Fconvert_cbz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jelius-sama","download_url":"https://codeload.github.com/jelius-sama/convert_cbz/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jelius-sama%2Fconvert_cbz/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276737507,"owners_count":25695699,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-24T02:00:09.776Z","response_time":97,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blazingly-fast","cbz","cbz-conver","cli","cli-app","comic","concurrent","convert","converter","cross-platform","doujinshi","go","golang","manga","unix"],"created_at":"2025-09-24T10:54:13.930Z","updated_at":"2025-09-24T10:54:17.688Z","avatar_url":"https://github.com/jelius-sama.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CBZ Converter\n\nA high-performance, concurrent tool for converting folders containing images into CBZ (Comic Book Archive) files. Built in Go for speed and reliability.\n\n![convert_cbz logo](https://jelius.dev/assets/compressed/convert_cbz.webp)\n\n## Features\n\n- **High Performance**: Multi-threaded processing with configurable concurrency\n- **Smart Detection**: MIME-type based image detection (supports JPEG, PNG, GIF, WebP, HEIF, AVIF, and more)\n- **Cross-Platform**: Runs on Linux, macOS, Windows, and various Unix systems\n- **Professional Logging**: Color-coded output with detailed progress tracking\n- **Safe Operations**: Skips existing files, handles errors gracefully\n- **Comprehensive Reporting**: Detailed statistics and non-image file detection\n\n## Installation\n\n### Quick Build\n\nFor your current system:\n```bash\n./build.sh\n```\n\nFor all supported architectures:\n```bash\n./build.sh all\n```\n\nThe compiled binaries will be placed in the `./bin/` directory.\n\n### Manual Build\n\nIf you prefer to build manually:\n```bash\ngo build -o convert_cbz main.go\n```\n\n## Usage\n\n### Basic Syntax\n```bash\nconvert_cbz -input \u003cinput_folder\u003e -output \u003coutput_folder\u003e [options]\n```\n\n### Options\n\n| Flag | Description | Default |\n|------|-------------|---------|\n| `-input` | Input directory containing folders to convert | *required* |\n| `-output` | Output directory for CBZ files | *required* |\n| `-threads` | Number of concurrent processing threads | `4` |\n| `-dumb` | Archive all files without filtering | `false` (smart mode) |\n| `-help` | Show usage information | - |\n| `-version` | Show version information | - |\n\n### Examples\n\nSmart mode (default) - filters intelligently:\n```bash\nconvert_cbz -input ./manga -output ./cbz\n```\n\nDumb mode - archives everything:\n```bash\nconvert_cbz -input ./raw_folders -output ./archives -dumb\n```\n\nHigh-performance processing:\n```bash\nconvert_cbz -input /home/user/comics -output /home/user/cbz -threads 8\n```\n\nShow help:\n```bash\nconvert_cbz -help\n```\n\n## Processing Modes\n\n### Smart Mode (Default)\n**Includes:**\n- **Images**: JPEG, PNG, GIF, WebP, HEIF, AVIF, BMP, TIFF\n- **Text files**: TXT, MD, NFO, INFO (metadata/descriptions)  \n- **Video files**: MP4, AVI, MKV, MOV (supplementary content)\n- **Any content with image/text/video MIME types**\n\n**Excludes:**\n- **System files**: .DS_Store, Thumbs.db, desktop.ini\n- **Version control**: .git, .svn, .hg directories and files\n- **IDE files**: .vscode, .idea, .sublime-project\n- **Temporary files**: .swp, .swo, *~ backup files\n\n### Dumb Mode (`-dumb`)\n**Includes:** Everything - all files and folders are archived without any filtering whatsoever\n\n**Use cases:**\n- Preserving complete directory structures\n- Archiving mixed content where filtering might remove needed files\n- When you want maximum control over what gets included\n\n## How It Works\n\n1. **Directory Scanning**: Recursively scans each folder in the input directory\n2. **Content Analysis**: \n   - **Smart Mode**: Uses MIME type analysis and filename patterns to identify useful content\n   - **Dumb Mode**: Includes all files without any filtering\n3. **Archive Creation**: Creates compressed ZIP archives with `.cbz` extension\n4. **Concurrent Processing**: Distributes work across multiple threads for optimal performance\n5. **Progress Reporting**: Provides real-time feedback with colored logging\n\n## Supported Content Types\n\n### Smart Mode Detection\n- **Images**: Automatic MIME type detection for all formats\n- **Text**: Extensions (.txt, .md, .nfo) + text/* MIME types  \n- **Video**: Extensions (.mp4, .avi, .mkv) + video/* MIME types\n- **Unknown**: Fail-safe inclusion for unidentifiable files\n\n### All Formats Include\n- **Image formats**: JPEG, PNG, GIF, BMP, TIFF, WebP, HEIF, AVIF\n- **Video formats**: MP4, AVI, MKV, MOV, WMV, FLV, WebM\n- **Text formats**: TXT, MD, NFO, INFO, README\n\n## Output Structure\n\n```\ninput/\n├── Manga Title 1/\n│   ├── page001.jpg\n│   ├── page002.png\n│   └── info.txt\n└── Manga Title 2/\n    ├── 01.jpg\n    └── 02.jpg\n\noutput/\n├── Manga Title 1.cbz\n└── Manga Title 2.cbz\n```\n\n## Logging and Feedback\n\nThe tool provides professional logging with color-coded output:\n\n- **[INFO]** - General information (blue)\n- **[OK]** - Successful operations (green)  \n- **[WARN]** - Warnings and skipped items (yellow)\n- **[ERROR]** - Error conditions (red)\n\n### Sample Output\n```\n[INFO] Starting CBZ conversion with 4 threads\n[INFO] Input:  ./manga\n[INFO] Output: ./cbz\n[INFO] Mode: SMART - filtering files intelligently\n[INFO] Found 199 folders to process\n[WORKER 1] Processing: [Author] Title Chapter 1\n[OK] [WORKER 1] Created: Title Chapter 1.cbz\n[WARN] [WORKER 2] Found 2 files excluded by smart filtering\n...\n[INFO] Conversion completed\n[INFO] Total folders:     199\n[OK] Successful:        197\n[WARN] Skipped:           2\n[INFO] Files excluded:    15 (smart filtering)\n[INFO] Success rate:      100.0%\n```\n\n## Performance Considerations\n\n- **Thread Count**: Default is 4 threads. Increase for faster processing on multi-core systems\n- **Memory Usage**: Each worker uses minimal memory; safe to run many threads\n- **I/O Optimization**: Uses buffered operations and compression for efficiency\n- **Resource Limits**: Automatically caps threads at 2× CPU cores to prevent system overload\n\n## Error Handling\n\nThe tool handles various error conditions gracefully:\n\n- **Missing directories**: Clear error messages with exit codes\n- **Permission issues**: Skips inaccessible files with warnings\n- **Corrupted files**: Uses fail-safe approach to include ambiguous files\n- **Existing files**: Skips existing CBZ files to prevent overwriting\n- **Individual failures**: Continues processing other folders if one fails\n\n## Technical Details\n\n- **Language**: Go 1.19+\n- **Archive Format**: ZIP with DEFLATE compression\n- **MIME Detection**: Uses Go's `http.DetectContentType()` for robust file type identification\n- **Concurrency**: Worker pool pattern with bounded channels\n- **Cross-Platform**: Builds for 20+ OS/architecture combinations\n\n## Supported Platforms\n\nThe build script supports:\n- **Linux**: AMD64, ARM, ARM64, PowerPC, MIPS, S390X\n- **macOS**: Intel (AMD64) and Apple Silicon (ARM64)\n- **FreeBSD**: AMD64, 386\n- **OpenBSD**: AMD64, 386, ARM64\n- **NetBSD**: AMD64, 386, ARM\n- **Other**: DragonFlyBSD, Solaris, Plan 9\n\n## Contributing\n\n1. Fork the repository\n2. Create your feature branch\n3. Add tests for new functionality\n4. Ensure all builds pass: `./build.sh all`\n5. Submit a pull request\n\n## License\n\nThis project is released under the MIT License.\n\n## Troubleshooting\n\n### Common Issues\n\n**Q: \"No files found to archive\" error**\n- Smart mode: Check that folders contain images, text, or video files\n- Dumb mode: Verify the folder actually contains files\n- Check file permissions are readable\n\n**Q: Too many/few files being included**\n- Use `-dumb` for complete archiving without filtering\n- Smart mode intentionally excludes system files and VCS data\n- Check the excluded files count in the final statistics\n\n**Q: CBZ files not opening in comic readers**\n- Ensure input folders contain valid image files\n- Some readers may need specific file ordering\n- Try both smart and dumb modes to see which works better\n\n**Q: Permission denied errors**\n- Check read permissions on input directory  \n- Check write permissions on output directory\n- Run with appropriate user privileges\n\n**Q: High memory usage**\n- Reduce thread count with `-threads` flag\n- Process smaller batches of folders Check that folders contain actual image files\n- Verify file permissions are readable\n\n**Q: High memory usage**\n- Reduce thread count with `-threads` flag\n- Process smaller batches of folders\n\n**Q: CBZ files not opening in comic readers**\n- Ensure input folders contain valid image files\n- Some readers may need specific file ordering\n\n**Q: Permission denied errors**\n- Check read permissions on input directory\n- Check write permissions on output directory\n- Run with appropriate user privileges\n\n### Performance Tips\n\n- Use SSD storage for both input and output directories\n- Set thread count to match your CPU cores (or slightly higher)\n- Process folders in smaller batches for very large collections\n- Close other resource-intensive applications during conversion\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjelius-sama%2Fconvert_cbz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjelius-sama%2Fconvert_cbz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjelius-sama%2Fconvert_cbz/lists"}