{"id":36385771,"url":"https://github.com/gomzyakov/image-placeholder","last_synced_at":"2026-01-11T15:01:46.612Z","repository":{"id":318183946,"uuid":"1070239802","full_name":"gomzyakov/image-placeholder","owner":"gomzyakov","description":"🍉 Simple image placeholder generator on PHP","archived":false,"fork":false,"pushed_at":"2025-10-05T17:12:51.000Z","size":26,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-05T18:14:14.181Z","etag":null,"topics":["image-placeholder","image-placeholders","php","placeholder","placeholder-image","placeholders","placeholders-service"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/gomzyakov/image-placeholder","language":"PHP","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/gomzyakov.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-10-05T14:51:47.000Z","updated_at":"2025-10-05T17:16:10.000Z","dependencies_parsed_at":"2025-10-05T18:14:18.677Z","dependency_job_id":"ebcb884c-5b46-4f85-8edb-1b32f73e2bc0","html_url":"https://github.com/gomzyakov/image-placeholder","commit_stats":null,"previous_names":["gomzyakov/image-placeholder"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/gomzyakov/image-placeholder","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gomzyakov%2Fimage-placeholder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gomzyakov%2Fimage-placeholder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gomzyakov%2Fimage-placeholder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gomzyakov%2Fimage-placeholder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gomzyakov","download_url":"https://codeload.github.com/gomzyakov/image-placeholder/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gomzyakov%2Fimage-placeholder/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28309567,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T14:58:17.114Z","status":"ssl_error","status_checked_at":"2026-01-11T14:55:53.580Z","response_time":60,"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":["image-placeholder","image-placeholders","php","placeholder","placeholder-image","placeholders","placeholders-service"],"created_at":"2026-01-11T15:01:46.520Z","updated_at":"2026-01-11T15:01:46.600Z","avatar_url":"https://github.com/gomzyakov.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simple image placeholder generator on PHP\n\nA simple package that allows you to create placeholder images for your PHP website.\n\n### Features\n\n- 🎉 Deterministic output by seed\n- 🏞️ PNG binary output ready to save or stream\n- 🔒 Size and component bounds clamped for safety\n- 🦄 Zero external binaries; pure PHP + GD\n\n### Examples\n\nBelow are sample outputs generated by this library:\n\n![Image placeholder generated with PHP (example three)](tests/images/example_3.png) ![Image placeholder generated with PHP (example one)](tests/images/example_1.png) ![Image placeholder generated with PHP (example two)](tests/images/example_2.png)\n\n### Requirements\n\n- PHP 8.3+\n- `ext-gd` enabled (for image creation and PNG encoding)\n\n### Installation\n\n```sh\ncomposer require gomzyakov/image-placeholder\n```\n\n### Usage\n\n```php\n\u003c?php\n\nuse Gomzyakov\\ImagePlaceholder;\n\n$generator = new ImagePlaceholder();\n\n// Generate a 320x180 PNG as binary string (deterministic by seed)\n$png = $generator-\u003egenerate(320, 180, seed: 'my-seed', cx: 4, cy: 3);\n\n// Save to disk\nfile_put_contents(__DIR__ . '/placeholder.png', $png);\n```\n\n#### Send as HTTP response\n\n```php\n\u003c?php\n\nuse Gomzyakov\\ImagePlaceholder;\n\n$generator = new ImagePlaceholder();\n$png = $generator-\u003egenerate(48, 48, 'avatar-seed');\n\nheader('Content-Type: image/png');\nheader('Content-Length: ' . strlen($png));\necho $png;\n```\n\n### API\n\n```php\nstring ImagePlaceholder::generate(\n    int $width,\n    int $height,\n    string $seed = 'default',\n    int $cx = 4,\n    int $cy = 3\n)\n```\n\n- **width, height**: Target image size in pixels. Clamped to [1..2000].\n- **seed**: Any string. Same inputs → identical output PNG.\n- **cx, cy**: BlurHash component counts. Clamped to [1..9].\n\nReturns a PNG binary string. Throws `RuntimeException` if image creation fails.\n\n### Determinism\n\nThe placeholder is generated from a pseudo-random source seeded by `seed`. Using the same tuple `(width, height, seed, cx, cy)` produces identical PNG output.\n\n### Testing\n\nRun the test suite:\n\n```sh\ncomposer phpunit\n```\n\n### License\n\nMIT — see [LICENSE](LICENSE).\n\n### Support\n\nFound an issue or have a suggestion? Please open an issue in the repository: `https://github.com/gomzyakov/image-placeholder`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgomzyakov%2Fimage-placeholder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgomzyakov%2Fimage-placeholder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgomzyakov%2Fimage-placeholder/lists"}