{"id":19168123,"url":"https://github.com/masx200/long-image-split-square","last_synced_at":"2026-02-15T14:33:30.626Z","repository":{"id":37051686,"uuid":"240850407","full_name":"masx200/long-image-split-square","owner":"masx200","description":"批量把长图竖直拆分成接近正方形的小图片的脚本  给文件读取异步操作限流,防止文件打开过多报错","archived":false,"fork":false,"pushed_at":"2024-12-20T08:52:23.000Z","size":189,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-23T19:51:20.451Z","etag":null,"topics":["image-processing"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/masx200.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}},"created_at":"2020-02-16T07:32:15.000Z","updated_at":"2024-12-20T08:43:29.000Z","dependencies_parsed_at":"2024-11-09T09:51:31.141Z","dependency_job_id":null,"html_url":"https://github.com/masx200/long-image-split-square","commit_stats":{"total_commits":58,"total_committers":3,"mean_commits":"19.333333333333332","dds":0.3620689655172413,"last_synced_commit":"5d2f8e9d4d948060d865adeee85b0dfe93768905"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masx200%2Flong-image-split-square","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masx200%2Flong-image-split-square/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masx200%2Flong-image-split-square/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masx200%2Flong-image-split-square/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/masx200","download_url":"https://codeload.github.com/masx200/long-image-split-square/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248080746,"owners_count":21044551,"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","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":["image-processing"],"created_at":"2024-11-09T09:41:21.579Z","updated_at":"2026-02-15T14:33:30.534Z","avatar_url":"https://github.com/masx200.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# long-image-split-square\n\n此仓库仅供学习交流之用\n\n批量把长图竖直或水平拆分成接近正方形的小图片的脚本\n\n给文件读取异步操作限流,防止文件打开过多报错\n\n这些图片往往是微博图片特色，或者是全景照片\n\n## 安装依赖\n\n先安装 `GraphicsMagick`\n\n```shell\nsudo apt install graphicsmagick\n```\n\n或者下载`GraphicsMagick`\n\nhttps://cdn.jsdelivr.net/gh/masx200/long-image-split-square@GraphicsMagick-1.3.34-Q16-win64/GraphicsMagick-1.3.34-Q16-win64-dll.exe.zip\n\nhttps://cdn.jsdelivr.net/gh/masx200/long-image-split-square@GraphicsMagick-1.3.34-Q16-win64/GraphicsMagick-1.3.34.tar.xz\n\n如果要处理`webp`文件需要安装`libwebp`\n\n```shell\nsudo apt install  libwebp\n```\n\n或者下载`libwebp`的可执行文件\n\nhttp://downloads.webmproject.org/releases/webp/\n\nhttps://cdn.jsdelivr.net/gh/masx200/long-image-split-square@libwebp/libwebp-1.0.1-windows-x64.zip\n\nhttps://cdn.jsdelivr.net/gh/masx200/long-image-split-square@libwebp-1.1.0-aarch64/libwebp-1.1.0-aarch64.zip\n\n官方说明\n\nhttps://github.com/webmproject/libwebp\n\nhttp://www.linuxfromscratch.org/blfs/view/svn/general/libwebp.html\n\nhttp://www.graphicsmagick.org/README.html\n\n## 安装 `node_modules`\n\n```\nyarn add @masx200/long-image-split-square\n```\n\n```shell\nyarn install\n```\n\n## 编译脚本\n\n```shell\nyarn build\n```\n\n## 运行脚本\n\n```shell\nyarn start\n```\n\n# 长图判定方法\n\n图片长边与短边的比例大于 3，且短边大于 400 像素,横向或竖向均可\n\n## 配置\n\n编辑`image-config.json`文件\n\nhttps://github.com/masx200/long-image-split-square/blob/master/dist/IMAGECONFIG.d.ts\n\n`inputextentions`：输入的文件扩展名,使用逗号分隔\n\n`input`：输入文件的目录\n\n`output`：输出文件的目录\n\n`outputextention`:输出文件的扩展名\n\n`maxpixels`:输出图片的最大像素总数限制,若无限制,则为 0\n\n```ts\ninterface IMAGECONFIG {\n    inputextentions: string[];\n    input: string;\n    output: string;\n    outputextention: string;\n    maxpixels: number;\n}\n```\n\n# 支持的图片格式\n\n`webp` 和 `GraphicsMagick Supported Formats`\n\nhttps://github.com/masx200/long-image-split-square/blob/master/gm%20convert%20-list%20format.txt\n\nhttp://www.graphicsmagick.org/formats.html\n\n# 命令行用法示例\n\n必选参数 `input`:类型`string`,输入图片目录\n\n必选参数 `output`:类型`string`,输出图片目录\n\n可选参数 `maxpixels`:类型`number`,输出图片最大像素数\n\n可选参数 concurrent:类型:number,同时运行的图片处理进程最大值\n\n可选参数 gm-path: 类型:string,输入 gm 的路径\n\n可选参数 cwebp-path: 类型:string,输入 cwebp 的路径\n\n```shell\nnode ./dist/cli.js --input=D:/baidupandownload/图片输入  --output=D:/baidupandownload/输出切割图片/\n```\n\n```shell\nnode ./dist/cli.js --input=D:/baidupandownload/图片输入  --output=D:/baidupandownload/输出切割图片/ --maxpixels=4000000 --concurrent=4\n```\n\n```shell\nnpx @masx200/long-image-split-square --input=D:/baidupandownload/图片输入  --output=D:/baidupandownload/输出切割图片/ --maxpixels=4000000\n```\n\n# 更新日志\n\n升级版本 GraphicsMagick 1.3.45 之后支持了 webp 作为输入文件格式了\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmasx200%2Flong-image-split-square","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmasx200%2Flong-image-split-square","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmasx200%2Flong-image-split-square/lists"}