{"id":42095595,"url":"https://github.com/lexo-ch/acf-image-focus","last_synced_at":"2026-01-26T11:18:56.848Z","repository":{"id":183884262,"uuid":"670918864","full_name":"lexo-ch/acf-image-focus","owner":"lexo-ch","description":"Show selected area of the image.","archived":false,"fork":false,"pushed_at":"2025-09-30T21:41:19.000Z","size":770,"stargazers_count":5,"open_issues_count":4,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-30T23:27:29.561Z","etag":null,"topics":["acf","acf-field","php8","plugin","releases","updates","wordpress","wordpress-plugin"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lexo-ch.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2023-07-26T06:16:08.000Z","updated_at":"2025-09-30T21:41:22.000Z","dependencies_parsed_at":"2023-11-07T09:31:11.187Z","dependency_job_id":"1e773b91-1317-4337-8279-8bd8194ef0f4","html_url":"https://github.com/lexo-ch/acf-image-focus","commit_stats":null,"previous_names":["lexo-ch/acf-image-focus"],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/lexo-ch/acf-image-focus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lexo-ch%2Facf-image-focus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lexo-ch%2Facf-image-focus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lexo-ch%2Facf-image-focus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lexo-ch%2Facf-image-focus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lexo-ch","download_url":"https://codeload.github.com/lexo-ch/acf-image-focus/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lexo-ch%2Facf-image-focus/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28777012,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T09:42:00.929Z","status":"ssl_error","status_checked_at":"2026-01-26T09:42:00.591Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["acf","acf-field","php8","plugin","releases","updates","wordpress","wordpress-plugin"],"created_at":"2026-01-26T11:18:56.035Z","updated_at":"2026-01-26T11:18:56.843Z","avatar_url":"https://github.com/lexo-ch.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LEXO ACF Image Focus\nACF extension for displaying the images with different proportions in predefined \"frame\" by setting position, without cropping.\n\nThis extension adds a new \"LEXO ACF Image Focus\" field to [Advanced Custom Fields](https://www.advancedcustomfields.com/). It works similar to a default [ACF Image field](https://www.advancedcustomfields.com/resources/image/).\n\n---\n## Versioning\nRelease tags are created with Semantic versioning in mind. Commit messages were following convention of [Conventional Commits](https://www.conventionalcommits.org/).\n\n---\n## Compatibility\n- WordPress version `\u003e=4.7`. Tested and works fine up to `6.8.2`.\n- PHP version `\u003e=7.4.1`. Tested and works fine up to `8.3.0`.\n- Minimum major ACF version `5`. Tested and works fine up to `6.2.9`.\n\n---\n## Installation\n1. Go to the [latest release](https://github.com/lexo-ch/acf-image-focus/releases/latest/).\n2. Under Assets, click on the link named `Version x.y.z`. It's a compiled build.\n3. Extract zip file and copy the folder into your `wp-content/plugins` folder and activate LEXO ACF Image Focus in plugins admin page. Alternatively, you can use downloaded zip file to install it directly from your plugin admin page.\n\n---\n## Usage\nUse it as any other ACF field.\n\n\u003cimg src=\"/screenshots/1.jpeg?raw=true\"\u003e\n\u003cblockquote\u003e\n    \u003csmall\u003eSelecting return format: (1) Image Array and (2) Image Element.\u003c/small\u003e\n\u003c/blockquote\u003e\n\n---\n\u003cimg src=\"/screenshots/2.jpeg?raw=true\"\u003e\n\u003cblockquote\u003e\n    \u003csmall\u003e(1) Selecting Image Size of the image used in frontend \u003c/small\u003e\u003cbr\u003e\n    \u003csmall\u003e(2) Selecting Image Aspect Ratio of the image used in frontend and in the \"frame\" as well. \u003c/small\u003e\n\u003c/blockquote\u003e\n\n---\n\u003cimg src=\"/screenshots/3.jpeg?raw=true\"\u003e\n\u003cblockquote\u003e\n    \u003csmall\u003e(1) \"Frame\" over the image in desired aspect ratio. In our example that \"frame\" has aspect ratio of 1.7 over the portrait image. \"Frame\" can be dragged to desired position.\u003c/small\u003e\n\u003c/blockquote\u003e\n\n---\n\u003cimg src=\"/screenshots/4.jpeg?raw=true\"\u003e\n\u003cblockquote\u003e\n    \u003csmall\u003eFinal result in the frontend. Image uses selected image size (Medium in our example) but only the area selected by \"frame\" is shown, no additional crops of the image are being made.\u003c/small\u003e\n\u003c/blockquote\u003e\n\n---\n## Return values\n### Image array\nReturn value is array with folowing elements:\n\n- (int) `image_id` - ID of the image.\n- (string) `field_name` - ACF field name.\n- (string) `field_key` - ACF field key.\n- (string) `image_size` - Image size.\n- (float) `position_x` - Value (percentage) of the X-axis (equivalent to `left`).\n- (float) `position_y` - Value (percentage) of the Y-axis (equivalent to `top`).\n- (float) `aspect_ratio` - Image aspect ratio in frontend.\n- (string) `field_classes` - Image classes in frontend.\n- (string) `url` - Image URL.\n- (string) `full_url` - Full image URL.\n- (int) `width` - Width in pixels.\n- (int) `height` - Height in pixels.\n- (string) `alt` - Image alt.\n- (string) `author` - ID of the image uploader.\n- (string) `description` - Image description.\n- (string) `caption` - Image caption.\n- (int) `uploaded_to` - ID of the post on on which image has been uploaded. If image is not related to any post then it defaults to `0`.\n- (string) `date` - Image upload date.\n- (string) `mime_type` - Image mime type.\n- (string) `subtype` - Image subtype.\n\n*Example*\n\n```php\nArray\n(\n    [image_id] =\u003e 13\n    [field_name] =\u003e acf_image_focus_field\n    [field_key] =\u003e field_630b58a621924\n    [image_size] =\u003e medium\n    [position_x] =\u003e 0\n    [position_y] =\u003e 16.13\n    [aspect_ratio] =\u003e 1.778\n    [field_classes] =\u003e class1 class2\n    [url] =\u003e http://acfimagefocus.test/wp-content/uploads/2023/07/test-image-768x599.webp\n    [full_url] =\u003e http://acfimagefocus.test/wp-content/uploads/2023/07/test-image.webp\n    [width] =\u003e 768\n    [height] =\u003e 671\n    [alt] =\u003e \n    [author] =\u003e 1\n    [description] =\u003e \n    [caption] =\u003e \n    [uploaded_to] =\u003e 0\n    [date] =\u003e 2023-11-07 08:17:27\n    [modified] =\u003e 2023-11-07 08:17:27\n    [mime_type] =\u003e image/webp\n    [subtype] =\u003e webp\n)\n```\n\n### Image element\nReturn value is `\u003cimg\u003e` tag with already applied Image array.\n\n*Example*\n```html\n\u003cimg\n    data-image-id=\"13\"\n    class=\"acf-image-focus class1 class2\"\n    loading=\"lazy\"\n    decoding=\"async\"\n    width=\"768\"\n    height=\"671\"\n    src=\"http://acfimagefocus.test/wp-content/uploads/2023/07/test-image-768x599.webp\" \n    alt=\"LEXO ACF Image Focus\" \n    style=\"object-fit: cover; object-position: 0% 16.13%; aspect-ratio: 1.778; height: auto; max-width: 100%\"\n\u003e\n```\n\n---\n## Filters\n#### - `acfif/admin/localized-script`\n*Parameters*\n`apply_filters('acfif/admin/localized-script', $args);`\n- $args (array) The array which will be used for localizing `acfifAdminLocalized` variable in the admin.\n\n#### - `acfif/enqueue/admin-acfif.js`\n*Parameters*\n`apply_filters('acfif/enqueue/admin-acfif.js', $args);`\n- $args (bool) Printing of the file `admin-acfif.js` (script id is `acfif/admin-acfif.js-js`). It also affects printing of the localized `acfifAdminLocalized` variable.\n\n#### - `acfif/enqueue/admin-acfif.css`\n*Parameters*\n`apply_filters('acfif/enqueue/admin-acfif.css', $args);`\n- $args (bool) Printing of the file `admin-acfif.css` (stylesheet id is `acfif/admin-acfif.css-css`).\n\n#### - `acfif/image/style-attribute`\n*Parameters*\n`apply_filters('acfif/image/style-attribute', $args);`\n- $args (array) The array which will be used for `style` attribute of the LEXO ACF Image Focus image element.\n\n#### - `acfif/image/style-attribute/name={$acf_field_name}`\n*Parameters*\n`apply_filters('acfif/image/style-attribute/name={$acf_field_name}', $args);`\n- $args (array) The array which will be used for `style` attribute of the LEXO ACF Image Focus image element with provided name.\n\n#### - `acfif/image/style-attribute/key={$acf_field_key}`\n*Parameters*\n`apply_filters('acfif/image/style-attribute/key={$acf_field_key}', $args);`\n- $args (array) The array which will be used for `style` attribute of the LEXO ACF Image Focus image element with provided key.\n\n#### - `acfif/image/classes`\n*Parameters*\n`apply_filters('acfif/image/classes', $args);`\n- $args (array) The array which will be used for `class` attribute of the LEXO ACF Image Focus image element.\n\n#### - `acfif/image/classes/name={$acf_field_name}`\n*Parameters*\n`apply_filters('acfif/image/classes/name={$acf_field_name}', $args);`\n- $args (array) The array which will be used for `class` attribute of the LEXO ACF Image Focus image element with provided name.\n\n#### - `acfif/image/classes/key={$acf_field_key}`\n*Parameters*\n`apply_filters('acfif/image/classes/key={$acf_field_key}', $args);`\n- $args (array) The array which will be used for `class` attribute of the LEXO ACF Image Focus image element with provided key.\n\n#### - `acfif/image/attributes`\n*Parameters*\n`apply_filters('acfif/image/attributes', $args);`\n- $args (array) The array which will be used for creating all attributes when printing LEXO ACF Image Focus field as image element.\n\n#### - `acfif/image/attributes/name={$acf_field_name}`\n*Parameters*\n`apply_filters('acfif/image/attributes/name={$acf_field_name}', $args);`\n- $args (array) The array which will be used for creating all attributes when printing LEXO ACF Image Focus field as image element with provided name.\n\n#### - `acfif/image/attributes/key={$acf_field_key}`\n*Parameters*\n`apply_filters('acfif/image/attributes/key={$acf_field_key}', $args);`\n- $args (array) The array which will be used for creating all attributes when printing LEXO ACF Image Focus field as image element with provided key.\n\n#### - `acfif/image/element`\n*Parameters*\n`apply_filters('acfif/image/element', $args);`\n- $args (string) HTML output of the LEXO ACF Image Focus image element.\n\n#### - `acfif/image/element/name={$acf_field_name}`\n*Parameters*\n`apply_filters('acfif/image/element/name={$acf_field_name}', $args);`\n- $args (string) HTML output of the LEXO ACF Image Focus image element with provided name.\n\n#### - `acfif/image/element/key={$acf_field_key}`\n*Parameters*\n`apply_filters('acfif/image/element/key={$acf_field_key}', $args);`\n- $args (string) HTML output of the LEXO ACF Image Focus image element with provided key.\n\n#### - `acfif/image/data`\n*Parameters*\n`apply_filters('acfif/image/data', $args);`\n- $args (array) The array which is returned if return type is array.\n\n#### - `acfif/image/data/name={$acf_field_name}`\n*Parameters*\n`apply_filters('acfif/image/data/name={$acf_field_name}', $args);`\n- $args (array) The array which is returned if return type is array for element with provided name.\n\n#### - `acfif/image/data/key={$acf_field_key}`\n*Parameters*\n`apply_filters('acfif/image/data/key={$acf_field_key}', $args);`\n- $args (array) The array which is returned if return type is array for element with provided key.\n\n---\n## Actions\n#### - `acfif/init`\n- Fires on LEXO ACF Image Focus init.\n\n#### - `acfif/localize/admin-acfif.js`\n- Fires right before LEXO ACF Image Focus admin script has been enqueued.\n\n---\n#### Dependencies\nThis plugin heavily relies on [Cropper.js](https://fengyuanchen.github.io/cropperjs/).\n\n---\n## Changelog\nChangelog can be seen on [latest release](https://github.com/lexo-ch/acf-image-focus/releases/latest/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flexo-ch%2Facf-image-focus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flexo-ch%2Facf-image-focus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flexo-ch%2Facf-image-focus/lists"}