{"id":22963515,"url":"https://github.com/samsyntx/image-setter","last_synced_at":"2025-04-02T03:45:42.150Z","repository":{"id":219804125,"uuid":"749929750","full_name":"samsyntx/image-setter","owner":"samsyntx","description":"Image Setter is a lightweight npm package that simplifies the process of compressing and converting image, making it easy to optimize and manipulate various IMage formats effortlessly.","archived":false,"fork":false,"pushed_at":"2024-02-23T16:35:46.000Z","size":20,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-04-24T13:36:11.112Z","etag":null,"topics":["compressor","image","image-processing","image-setter","imagecompression","imagetools","pngtojpg"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/image-setter","language":"TypeScript","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/samsyntx.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}},"created_at":"2024-01-29T17:12:38.000Z","updated_at":"2024-04-10T16:18:34.000Z","dependencies_parsed_at":"2024-12-14T19:35:50.716Z","dependency_job_id":"cad4e895-4eca-4024-bdd0-f8af142dcc9f","html_url":"https://github.com/samsyntx/image-setter","commit_stats":null,"previous_names":["webwiserin/image-setter","samsyntx/image-setter"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samsyntx%2Fimage-setter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samsyntx%2Fimage-setter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samsyntx%2Fimage-setter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samsyntx%2Fimage-setter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samsyntx","download_url":"https://codeload.github.com/samsyntx/image-setter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246752604,"owners_count":20827987,"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":["compressor","image","image-processing","image-setter","imagecompression","imagetools","pngtojpg"],"created_at":"2024-12-14T19:35:45.331Z","updated_at":"2025-04-02T03:45:42.133Z","avatar_url":"https://github.com/samsyntx.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Media Toolkit\n\nA versatile npm package providing functionalities to compress, convert file formats, and handle multimedia content seamlessly.\n\n### Installation\n\n```\nnpm install image-setter\n```\n\n## Usage\n\n### compressAndConvertToJPEG\n\nThis function compresses and converts an image file to JPEG format based on the specified settings.\n\n```\nimport { compressAndConvertToJPEG } from 'image-setter';\n\nconst file = /* your File object */;\nconst settings = {\n  toWidth: 300,\n  toHeight: 300,\n  quality: 0.6,\n  maxSize: 100 * 1024,\n};\n\ncompressAndConvertToJPEG({ file, settings })\n  .then((compressedBlob) =\u003e {\n    // Handle the compressed Blob as needed\n  })\n  .catch((error) =\u003e {\n    console.error('Error:', error);\n  });\n\n```\n\n### convertFileFormat\n\nThis function converts the file format of a given file.\n\n```\nimport { convertFileFormat } from 'image-setter';\n\nconst file = /* your File object */;\nconst targetFormat = 'image/png';\n\nconvertFileFormat({ file, targetFormat })\n  .then((convertedBlob) =\u003e {\n    // Handle the converted Blob as needed\n  })\n  .catch((error) =\u003e {\n    console.error('Error:', error);\n  });\n\n```\n\n### base64ToBinary\n\nConverts a base64-encoded string to a Uint8Array.\n\n```\nimport { base64ToBinary } from 'image-setter';\n\nconst base64String = /* your base64-encoded string */;\n\nconst binaryData = base64ToBinary(base64String);\n// Use binaryData as needed\n\n```\n\n### convertToBase64\n\nConverts a File object to a base64-encoded string.\n\n```\nimport { convertToBase64 } from 'image-setter';\n\nconst file = /* your File object */;\n\nconvertToBase64(file)\n  .then((base64String) =\u003e {\n    // Handle the base64-encoded string as needed\n  })\n  .catch((error) =\u003e {\n    console.error('Error:', error);\n  });\n\n```\n\n### fileAsArrayBuffer\n\nConverts a Compressed Image into Binary string.\n\n```\nimport { fileAsArrayBuffer } from 'image-setter';\n\nconst file = /* your Image File */;\n\nfileAsArrayBuffer(file)\n  .then((bufferData) =\u003e {\n    // Handle the bufferData string as needed\n  })\n  .catch((error) =\u003e {\n    console.error('Error:', error);\n  });\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamsyntx%2Fimage-setter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamsyntx%2Fimage-setter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamsyntx%2Fimage-setter/lists"}