{"id":13652411,"url":"https://github.com/nplowman/jsonapi-reusable-images","last_synced_at":"2025-04-23T03:30:49.113Z","repository":{"id":119656403,"uuid":"205465950","full_name":"nplowman/jsonapi-reusable-images","owner":"nplowman","description":"Drupal 8 module that provides an additional URL for Image entities that supports on-the-fly scaling and cropping.","archived":false,"fork":false,"pushed_at":"2019-09-13T22:43:41.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-10T03:35:28.315Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","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/nplowman.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}},"created_at":"2019-08-30T22:42:12.000Z","updated_at":"2019-09-13T22:43:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"f3b1e0be-1059-4735-a7be-92a0225fa1bb","html_url":"https://github.com/nplowman/jsonapi-reusable-images","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/nplowman%2Fjsonapi-reusable-images","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nplowman%2Fjsonapi-reusable-images/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nplowman%2Fjsonapi-reusable-images/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nplowman%2Fjsonapi-reusable-images/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nplowman","download_url":"https://codeload.github.com/nplowman/jsonapi-reusable-images/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250365299,"owners_count":21418665,"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-08-02T02:00:59.082Z","updated_at":"2025-04-23T03:30:46.326Z","avatar_url":"https://github.com/nplowman.png","language":"PHP","funding_links":[],"categories":["Drupal"],"sub_categories":["Drupal modules"],"readme":"# Installation\nThis module does not require any configuration. Simply enable this module\nand the JSON:API module.\n\n# Usage\n1. After enabling the module, you should see an additional property in the JSON\nresponse for File Entities named 'resizable_image_url':  \n \n```\nattributes: {\n  drupal_internal__fid: 3,\n  langcode: \"en\",\n  filename: \"nyan.gif\",\n  uri: {\n    value: \"public://2019-08/nyan.gif\",\n    url: \"/sites/default/files/2019-08/nyan.gif\"\n  },\n  filemime: \"image/gif\",\n  filesize: 761850,\n  status: true,\n  created: \"2019-08-30T22:53:41+00:00\",\n  changed: \"2019-08-30T22:53:48+00:00\",\n  resizable_image_url: \"http://example.com/resizable-images/3/nyan.gif\"\n}\n```\n\n2. You can use 'w' and 'h' query parameters with this URL to scale and crop the \nimage to the size you need.\n\n## Examples:\n\nScale and crop to 200x200 thumbnail:\n\n```http://headless-drupal.docksal/resizable-images/3/nyan.gif?w=200\u0026h=200```\n\nScale width to 200 pixels and scale height proportionally:\n```http://headless-drupal.docksal/resizable-images/3/nyan.gif?w=200```\n\nScale height to 500 pixels and scale width proporitionally:\n```http://headless-drupal.docksal/resizable-images/3/nyan.gif?h=500```\n\n# Notes\n- Supported Image Formats: jpg, png, gif \n- Note that animated gifs can be cropped, but only the first frame will be \navailable in derivative image.\n- While the module was built with the use case of JSON:API in mind, it is not a \nhard requirement. The resizable_image_url is attached to file entities as a computed\nproperty, and can be also used with the core REST API and custom solutions.\n\n# Similar Modules\n[Consumer Image Styles](https://www.drupal.org/project/consumer_image_styles)\nConsumer Image Styles takes a different approach to solving the same problem as this module.\nThe advantage of JSON Resizable Images is that it allows you to request a resized\nimage with any width and height on-the-fly, while Consumer Image Styles requires\nyou configure preset Image Styles on the Drupal side. \n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnplowman%2Fjsonapi-reusable-images","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnplowman%2Fjsonapi-reusable-images","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnplowman%2Fjsonapi-reusable-images/lists"}