{"id":18304626,"url":"https://github.com/numtel/meteor-cfs-image-resize","last_synced_at":"2025-04-05T15:31:26.454Z","repository":{"id":150130695,"uuid":"42424895","full_name":"numtel/meteor-cfs-image-resize","owner":"numtel","description":"Resize images in CollectionFS using Jimp","archived":false,"fork":false,"pushed_at":"2016-09-07T07:59:13.000Z","size":5375,"stargazers_count":9,"open_issues_count":4,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-21T06:41:24.667Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/numtel.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":"2015-09-14T03:25:02.000Z","updated_at":"2018-04-02T23:01:32.000Z","dependencies_parsed_at":"2023-07-07T12:45:56.133Z","dependency_job_id":null,"html_url":"https://github.com/numtel/meteor-cfs-image-resize","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numtel%2Fmeteor-cfs-image-resize","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numtel%2Fmeteor-cfs-image-resize/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numtel%2Fmeteor-cfs-image-resize/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numtel%2Fmeteor-cfs-image-resize/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/numtel","download_url":"https://codeload.github.com/numtel/meteor-cfs-image-resize/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247358683,"owners_count":20926266,"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":[],"created_at":"2024-11-05T15:29:41.821Z","updated_at":"2025-04-05T15:31:26.446Z","avatar_url":"https://github.com/numtel.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# numtel:cfs-image-resize\n\nResize images for thumbnails in [CollectionFS](https://github.com/CollectionFS/Meteor-CollectionFS) using [`Jimp`](https://github.com/oliver-moran/jimp)\n\n## Installation\n\nThis package assumes you're using [CollectionFS](https://github.com/CollectionFS/Meteor-CollectionFS).\n\n```\nmeteor add numtel:cfs-image-resize\n```\n\n## Usage\n\nA `resizeImageStream` function is exposed when this package is installed. Call this function with options for resizing.\n\nOnly `image/png` and `image/jpeg` file types are supported.\n\nImages will be centered if the aspect ratio between the input and the output differs.\n\n```javascript\nImages = new FS.Collection(\"images\", {\n  stores: [\n    new FS.Store.GridFS(\"images\"),\n    new FS.Store.GridFS(\"thumbs\", {\n      beforeWrite: function(fileObj) {\n        // We return an object, which will change the\n        // filename extension and type for this store only.\n        return {\n          extension: 'jpeg',\n          type: 'image/jpeg'\n        };\n      },\n      transformWrite: resizeImageStream({\n        width: 100,\n        height: 50,\n        format: 'image/jpeg',\n        quality: 50\n      })\n    })\n  ],\n});\n```\n\n### Available Options\n\nOption | Description\n-------|-------------\n`width` | Output width in pixels, required\n`height` | Output height in pixels, required\n`format` | Format of output image, optional, default same as input, accepts `image/png` or `image/jpeg`\n`quality` | Output image quality number 0-100, only used with JPEG images, optional\n\n## Performance\n\nAlthough images are resized in a separate process to prevent the event loop from being blocked, large images will take significant time to resize due to the JavaScript implementation of the image encoders and decoders.\n\nFor high load situations where more capacity is needed, look into using GraphicsMagick using the [`cfs:graphicsmagick` Package](https://github.com/CollectionFS/Meteor-cfs-graphicsmagick).\n\n## Running Tests\n\nUse the standard command:\n\n```\nmeteor test-packages ./\n```\n\n## License\n\nMIT\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnumtel%2Fmeteor-cfs-image-resize","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnumtel%2Fmeteor-cfs-image-resize","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnumtel%2Fmeteor-cfs-image-resize/lists"}