{"id":13759865,"url":"https://github.com/humanmade/smart-media","last_synced_at":"2025-06-30T23:09:26.354Z","repository":{"id":33006891,"uuid":"142136617","full_name":"humanmade/smart-media","owner":"humanmade","description":"Smart Media enhancements for WordPress","archived":false,"fork":false,"pushed_at":"2025-06-13T11:14:16.000Z","size":1576,"stargazers_count":87,"open_issues_count":24,"forks_count":8,"subscribers_count":25,"default_branch":"master","last_synced_at":"2025-06-13T12:26:24.884Z","etag":null,"topics":["aws-rekognition","machine-learning","wordpress"],"latest_commit_sha":null,"homepage":"","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/humanmade.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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,"zenodo":null}},"created_at":"2018-07-24T09:31:58.000Z","updated_at":"2025-06-13T11:14:20.000Z","dependencies_parsed_at":"2024-04-19T18:33:30.616Z","dependency_job_id":"1fb7f29a-b325-435f-a3b8-3c358ceb41df","html_url":"https://github.com/humanmade/smart-media","commit_stats":{"total_commits":208,"total_committers":12,"mean_commits":"17.333333333333332","dds":"0.22596153846153844","last_synced_commit":"22bd0e73630e3f706572e8c404bcaf2abcf0c604"},"previous_names":[],"tags_count":95,"template":false,"template_full_name":null,"purl":"pkg:github/humanmade/smart-media","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/humanmade%2Fsmart-media","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/humanmade%2Fsmart-media/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/humanmade%2Fsmart-media/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/humanmade%2Fsmart-media/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/humanmade","download_url":"https://codeload.github.com/humanmade/smart-media/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/humanmade%2Fsmart-media/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259645863,"owners_count":22889694,"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":["aws-rekognition","machine-learning","wordpress"],"created_at":"2024-08-03T13:01:00.165Z","updated_at":"2025-06-30T23:09:26.334Z","avatar_url":"https://github.com/humanmade.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"\u003ctable width=\"100%\"\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd align=\"left\" width=\"70\"\u003e\n\t\t\t\u003cstrong\u003eSmart Media\u003c/strong\u003e\u003cbr /\u003e\n\t\t\tEnhanced media library features for WordPress.\n\t\t\u003c/td\u003e\n\t\t\u003ctd align=\"right\" width=\"20%\"\u003e\n\t\t\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003e\n\t\t\tA \u003cstrong\u003e\u003ca href=\"https://hmn.md/\"\u003eHuman Made\u003c/a\u003e\u003c/strong\u003e project. Maintained by @roborourke.\n\t\t\u003c/td\u003e\n\t\t\u003ctd align=\"center\"\u003e\n\t\t\t\u003cimg src=\"https://humanmade.com/uploads/2025/01/HM-red-square.svg\" width=\"100\" /\u003e\n\t\t\u003c/td\u003e\n\t\u003c/tr\u003e\n\u003c/table\u003e\n\nSmarter media features for WordPress.\n\nSome features in this plugin will work on their own however some are designed to augment the existing tools we use such as [Tachyon](https://github.com/humanmade/tachyon).\n\n## Features\n\n### Justified media library\n\nThe media library shows square thumbnails by default which can make it harder to find the right image. This feature makes the thumbnails keep their original aspect ratio, similar to the UI of Flickr.\n\nTo disable the feature add the following:\n\n```php\n\u003c?php\nadd_filter( 'hm.smart-media.justified-library', '__return_false' );\n```\n\n### Image editor\n\nThis feature overrides the built in WordPress image editing experience and gives you control over the crops of individual thumbs. There are also some UX improvements meaning there are fewer clicks required to make edits.\n\nTo disable the feature add the following:\n\n```php\n\u003c?php\nadd_filter( 'hm.smart-media.cropper', '__return_false' );\n```\n\nThe image cropping UI provides support for updating Gutenberg block attributes based on the current selection using the following filters:\n\n- `smartmedia.cropper.updateBlockAttributesOnSelect.\u003cblock name\u003e`\n- `smartmedia.cropper.selectSizeFromBlockAttributes.\u003cblock name\u003e`\n\nIn the above filters `\u003cblock name\u003e` should be replaced a dot separated version of your block name, for example `core/image` becomes `core.image`. The core image block attributes are mapped by default.\n\nMapping the selected image to block attributes:\n\n```js\naddFilter(\n  'smartmedia.cropper.updateBlockAttributesOnSelect.core.image',\n  'smartmedia/cropper/update-block-on-select/core/image',\n  /**\n   * @param {?Object} attributes  The filtered block attributes. Return null to bypass updating.\n   * @param {Object} image  The image data has the following shape:\n   *   {\n   *     name: \u003cstring\u003e,  The image size name\n   *     url: \u003cstring\u003e,  The URL for the sized image\n   *     width: \u003cint\u003e,  The width in pixels\n   *     height: \u003cint\u003e,  The height in pixels\n   *     label: \u003cstring\u003e,  The human readable name for the image size, only present for user selectable sizes\n   *     cropData: \u003c?object\u003e,  Null or object containing x, y, width and height properties\n   *   }\n   */\n  ( attributes, image ) =\u003e {\n    // Only user selectable image sizes have a label so return early if this is missing.\n    if ( ! image.label ) {\n      return attributes;\n    }\n\n    return {\n      sizeSlug: image.size,\n      url: image.url,\n    };\n  }\n);\n```\n\nUpdate the cropping UI selected size based on selected block attributes:\n\n```js\naddFilter(\n  'smartmedia.cropper.selectSizeFromBlockAttributes.core.image',\n  'smartmedia/cropper/select-size-from-block-attributes/core/image',\n  /**\n   * @param {?String} size  The image size slug.\n   * @param {Object} block  The currently selected block.\n   */\n  ( size, block ) =\u003e {\n    return size || block.attributes.sizeSlug || 'full';\n  }\n);\n```\n\nThe function takes 2 parameters:\n\n- `block`: The name of the block to map attributes for\n- `callback`: A function that accepts the image `size` name, an `image` object containing `url`, `width`, `height`, crop data and label for the image size, and lastly the full `attachment` data object.\n\nThe callback should return an object or `null`. Passing `null` will prevent updating the currently selected block.\n\n## Roadmap\n\nPlanned features include:\n\n- Duplicate image detection and consolidation\n- EXIF data editor\n\n## Contributing\n\nFirst of all thanks for using this plugin and thanks for contributing!\n\nTo get started check out the [contributing documentation](./CONTRIBUTING.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhumanmade%2Fsmart-media","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhumanmade%2Fsmart-media","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhumanmade%2Fsmart-media/lists"}