{"id":17642811,"url":"https://github.com/34j/pre-commit-shrink-image","last_synced_at":"2026-02-07T04:31:38.822Z","repository":{"id":259076025,"uuid":"870125731","full_name":"34j/pre-commit-shrink-image","owner":"34j","description":"pre-commit hook for shrinking images","archived":false,"fork":false,"pushed_at":"2026-01-19T17:05:26.000Z","size":12,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-19T23:16:28.252Z","etag":null,"topics":["github-pages","hexo","image","imagemagick","pre-commit","pre-commit-hook","pre-commit-hooks","python","shrink","shrink-image","shrink-images"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/34j.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-10-09T13:41:38.000Z","updated_at":"2025-11-28T13:37:37.000Z","dependencies_parsed_at":"2024-12-16T18:19:54.375Z","dependency_job_id":"7483f07c-1d20-4aa1-81dc-e0a0160ac1a1","html_url":"https://github.com/34j/pre-commit-shrink-image","commit_stats":null,"previous_names":["34j/pre-commit-shrink-image"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/34j/pre-commit-shrink-image","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/34j%2Fpre-commit-shrink-image","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/34j%2Fpre-commit-shrink-image/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/34j%2Fpre-commit-shrink-image/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/34j%2Fpre-commit-shrink-image/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/34j","download_url":"https://codeload.github.com/34j/pre-commit-shrink-image/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/34j%2Fpre-commit-shrink-image/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29186736,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T03:35:06.566Z","status":"ssl_error","status_checked_at":"2026-02-07T03:34:57.604Z","response_time":63,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["github-pages","hexo","image","imagemagick","pre-commit","pre-commit-hook","pre-commit-hooks","python","shrink","shrink-image","shrink-images"],"created_at":"2024-10-23T08:42:10.236Z","updated_at":"2026-02-07T04:31:38.808Z","avatar_url":"https://github.com/34j.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pre-commit-shrink-image\n\n## Installation\n\n```yaml\n- repo: https://github.com/34j/pre-commit-shrink-image\n  rev: \"8341bd6\" # Use the sha / tag you want to point at\n  hooks:\n    - id: shrink-image\n      args:\n        [\n          --image-glob,\n          \"images/*.{png,jpg}\",\n          --text-glob,\n          \"docs/*.md\",\n          --suffix,\n          webp,\n          --imagemagick-args,\n          \"-quality 92 -resize 2000000@\u003e -define webp:method=5 -define webp:use-sharp-yuv=1 -define webp:thread-level=1\",\n        ]\n```\n\n## Usage\n\nOnly staged images are processed.\nIf image extension is changed, the paths in the text files are also updated and the original images are deleted.\n\n```shell\n\u003e python3 -m pre_commit_shrink_image --help\nusage: pre_commit_shrink_image.py [-h] [--image-glob IMAGE_GLOB] [--text-glob TEXT_GLOB] [--imagemagick-args IMAGEMAGICK_ARGS] [--suffix SUFFIX] [--filelist FILELIST] [--dry-run] [files ...]\n\npositional arguments:\n  files\n\noptions:\n  -h, --help            show this help message and exit\n  --image-glob IMAGE_GLOB\n                        Glob pattern for images to replace\n  --text-glob TEXT_GLOB\n                        Glob pattern for text files to replace\n  --imagemagick-args IMAGEMAGICK_ARGS\n                        Arguments for ImageMagick's convert command\n  --suffix SUFFIX       Suffix of the new image files\n  --filelist FILELIST   File list\n  --dry-run             Dry run\n```\n\n## See Also\n\n- [ImageMagick – WebP Encoding Options](https://imagemagick.org/script/webp.php)\n- [ImageMagick と WebP #ImageMagick - Qiita](https://qiita.com/yoya/items/0848a6b0b39db4cd57c2)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F34j%2Fpre-commit-shrink-image","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F34j%2Fpre-commit-shrink-image","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F34j%2Fpre-commit-shrink-image/lists"}