{"id":36416936,"url":"https://github.com/focus-points/focuspoints-client","last_synced_at":"2026-01-11T17:00:00.825Z","repository":{"id":57732066,"uuid":"256288029","full_name":"Focus-Points/focuspoints-client","owner":"Focus-Points","description":"FocusPoints Client Library","archived":false,"fork":false,"pushed_at":"2025-01-20T16:19:12.000Z","size":103,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-14T00:56:45.040Z","etag":null,"topics":["image-compression","image-focal-point","image-manipulation","image-processing","image-retrieval"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Focus-Points.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}},"created_at":"2020-04-16T17:46:22.000Z","updated_at":"2020-05-06T13:13:50.000Z","dependencies_parsed_at":"2023-01-25T22:01:03.658Z","dependency_job_id":null,"html_url":"https://github.com/Focus-Points/focuspoints-client","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/Focus-Points/focuspoints-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Focus-Points%2Ffocuspoints-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Focus-Points%2Ffocuspoints-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Focus-Points%2Ffocuspoints-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Focus-Points%2Ffocuspoints-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Focus-Points","download_url":"https://codeload.github.com/Focus-Points/focuspoints-client/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Focus-Points%2Ffocuspoints-client/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28314253,"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-compression","image-focal-point","image-manipulation","image-processing","image-retrieval"],"created_at":"2026-01-11T17:00:00.151Z","updated_at":"2026-01-11T17:00:00.813Z","avatar_url":"https://github.com/Focus-Points.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Installation \u0026 Configuration\r\n\r\nIn order to start using the FocusPoints client functionality we need to choose the right module for our project and provide it with the correct configuration.\r\n\r\n## Manual Configuration\r\n\r\nAdd the following dependency to your project\r\n\r\n```xml\r\n\u003cdependency\u003e\r\n\t\u003cgroupId\u003eio.focuspoints\u003c/groupId\u003e\r\n\t\u003cartifactId\u003efocuspoints-client-core\u003c/artifactId\u003e\r\n\t\u003cversion\u003e1.0.1\u003c/version\u003e\r\n\u003c/dependency\u003e\r\n```\r\n\r\nDuring application startup the following classes need to be configured: `ImageServiceConfigurationProperties`, `TokenCreator` and `UrlCreator`. Below is an example of such a configuration:\r\n\r\n```java\r\nImageServiceConfigurationProperties imageServiceConfiguration = new ImageServiceConfigurationProperties();\r\nimageServiceConfiguration.setTokenId(\"myTokenId\");\r\nimageServiceConfiguration.setTokenSecret(\"myTokenSecret\");\r\n\r\nnew TokenCreator(imageServiceConfiguration);\r\nnew UrlCreator(imageServiceConfiguration);\r\n```\r\n\r\nThe `TokenCreator` and `UrlCreator` are singleton classes but need to be initialized once with the correct configuration. It is not needed to keep a reference to them.\r\n\r\n## ServletContext Configuration\r\n\r\nAdd the following dependency to your project\r\n\r\n```xml\r\n\u003cdependency\u003e\r\n\t\u003cgroupId\u003eio.focuspoints\u003c/groupId\u003e\r\n\t\u003cartifactId\u003efocuspoints-client-core-servlet\u003c/artifactId\u003e\r\n\t\u003cversion\u003e1.0.1\u003c/version\u003e\r\n\u003c/dependency\u003e\r\n```\r\n\r\nThis will setup a WebListener at application startup that initializes the FocusPoints client. Make sure the following context params are present in your application\r\n\r\n| Name                     | Description                              |\r\n|--------------------------|------------------------------------------|\r\n| focuspoints.token-id     | Your FocusPoints API Key ID              |\r\n| focuspoints.token-secret | Your FocusPoints API Key Secret          |\r\n\r\n\r\n## Spring Configuration\r\nAdd the following dependency to your project\r\n\r\n```xml\r\n\u003cdependency\u003e\r\n\t\u003cgroupId\u003eio.focuspoints\u003c/groupId\u003e\r\n\t\u003cartifactId\u003efocuspoints-client-core-spring\u003c/artifactId\u003e\r\n\t\u003cversion\u003e1.0.1\u003c/version\u003e\r\n\u003c/dependency\u003e\r\n```\r\n\r\nAdd the following import to your Spring configuration\r\n\r\n```java\r\n@Import(FocusPointsConfiguration.class)\r\n```\r\n\r\nMake sure the following properties are present in your environment configuration\r\n\r\n| Name                     | Description                              |\r\n|--------------------------|------------------------------------------|\r\n| focuspoints.token-id     | Your FocusPoints API Key ID              |\r\n| focuspoints.token-secret | Your FocusPoints API Key Secret          |\r\n\r\n\r\n## Spring Boot Configuration\r\nAdd the following dependency to your projetc\r\n\r\n```xml\r\n\u003cdependency\u003e\r\n\t\u003cgroupId\u003eio.focuspoints\u003c/groupId\u003e\r\n\t\u003cartifactId\u003efocuspoints-client-core-spring-boot-starter\u003c/artifactId\u003e\r\n\t\u003cversion\u003e1.0.1\u003c/version\u003e\r\n\u003c/dependency\u003e\r\n```\r\n\r\nThis will cause the `io.focuspoints.client.FocusPointsAutoConfiguration` to be automatically included at application startup.\r\n\r\n\r\nMake sure the following properties are present in your environment configuration\r\n\r\n| Name                     | Description                              |\r\n|--------------------------|------------------------------------------|\r\n| focuspoints.token-id     | Your FocusPoints API Key ID              |\r\n| focuspoints.token-secret | Your FocusPoints API Key Secret          |\r\n\r\n## Configuration Properties\r\n\r\nThe following configuration properties are supported.\r\n\r\n| Name                                     | Required | Default Value                | Description                                                                        |\r\n|------------------------------------------|----------|------------------------------|------------------------------------------------------------------------------------|\r\n| focuspoints.token-id                     | True     |                              | Your FocusPoints API Key ID                                                        |\r\n| focuspoints.token-secret                 | True     |                              | Your FocusPoints API Key Secret                                                    |\r\n| focuspoints.enabled                      | False    | True                         | Enables the use of focuspoints. When disabled, the original image URL will be used |\r\n| focuspoints.url                          | False    | https://image.focuspoints.io | The focuspoints server endpoint                                                    |\r\n| focuspoints.token-request-parameter-name | False    | _jwt                         | The name of the request parameter containing the token                             |\r\n\r\n# Using FocusPoints in your frontend\r\n\r\n## JSP and Freemarker\r\n\r\nAdd the following dependency to your projetc\r\n\r\n```xml\r\n\u003cdependency\u003e\r\n\t\u003cgroupId\u003eio.focuspoints\u003c/groupId\u003e\r\n\t\u003cartifactId\u003efocuspoints-client-taglib\u003c/artifactId\u003e\r\n\t\u003cversion\u003e1.0.1\u003c/version\u003e\r\n\u003c/dependency\u003e\r\n```\r\n\r\nThis will add a taglib to your project containing a tld with uri `http://www.focuspoints.io/tags`. The tld defines two tags used for image transformation and image resizing.\r\n\r\n### The image transformation tag\r\n\r\nThe image transformation tag generates a URL containing the correct parameters for transforming an image using the desired parameters. The images created by the transformation operation always matches the desired with and height. When it is required to crop certain parts of the image the focus point coordinate is used to determin which part of the image must not be removed.\r\n\r\n| Attribute   | Required | Description |\r\n|-------------|----------|-------------|\r\n| url         | true     | An absolute URL of the image that is used. |\r\n| filename    | false    | The filename of the image. |\r\n| width       | true     | The desired width of the generated image variant in pixels. Must be a positive `Integer` value |\r\n| height      | true     | The desired height of the generated image variant in pixels. Must be a positive `Integer` value |\r\n| focusPointX | false    | The focus point coordinate for the x-axis. Must be a `Double` value between -1 and 1. |\r\n| focusPointY | false    | The focus point coordinate for the y-axis. Must be a `Double` value between -1 and 1. |\r\n| var         | false    | The string to use when binding the result to the page, request, session or application scope. If not specified the result gets outputted to the writer (i.e. typically directly to the JSP) |\r\n| scope       | false    | The scope to use when exporting the result to a variable. This attribute is only used when **var** is also set. Possible values are **page**, **request**, **session** and **application**. When no value is specified this defaults to the **page** scope |\r\n\r\n#### Examples\r\n```xml\r\n\u003c%-- Import imageservice taglib --%\u003e\r\n\u003c%@ taglib prefix=\"focuspoints\" uri=\"http://www.focuspoints.io/tags\" %\u003e\r\n\r\n\u003c%-- Transform an image using the settings as specified in the tag --%\u003e\r\n\u003cfocuspoints:transform url=\"https://path/to/my/image\" filename=\"my-image.jpg\" width=\"1280\" height=\"360\" focusPointX=\"0.6\" focusPointY=\"-0.35\" /\u003e\r\n\r\n\u003c%-- Transform an image using the settings as specified in the tag and store the result in the page scope --%\u003e\r\n\u003cfocuspoints:transform var=\"imageTransformed1280x360\" url=\"https://path/to/my/image\" filename=\"my-image.jpg\" width=\"1280\" height=\"360\" focusPointX=\"0.6\" focusPointY=\"-0.35\" /\u003e\r\n```\r\n\r\n### The image resize tag\r\n\r\nThe image resize tag generates a URL containing the correct parameters for resizing an image using the desired parameters. Where the image transformation tag can crop certain parts of an image this is not always desired (e.g. when displaying a company logo). The resize operation makes sure the image fits within the desired dimensions but only fits the longest side of the image. The shortest side could therefor be smaller than the provided with or height.\r\n\r\n| Attribute | Required | Description |\r\n|-----------|----------|-------------|\r\n| url       | true     | An absolute URL of the image that is used. |\r\n| filename  | false    | The filename of the image. |\r\n| width     | true     | The desired width of the generated image variant in pixels. Must be a positive `Integer` value |\r\n| height    | true     | The desired height of the generated image variant in pixels. Must be a positive `Integer` value |\r\n| var       | false    | The string to use when binding the result to the page, request, session or application scope. If not specified the result gets outputted to the writer (i.e. typically directly to the JSP) |\r\n| scope     | false    | The scope to use when exporting the result to a variable. This attribute is only used when **var** is also set. Possible values are **page**, **request**, **session** and **application**. When no value is specified this defaults to the **page** scope |\r\n\r\n#### Examples\r\n```xml\r\n\u003c%-- Import imageservice taglib --%\u003e\r\n\u003c%@ taglib prefix=\"focuspoints\" uri=\"http://www.focuspoints.io/tags\" %\u003e\r\n\r\n\u003c%-- Resize an image to the desired with and height --%\u003e\r\n\u003cfocuspoints:resize url=\"https://path/to/my/image\" filename=\"my-image.jpg\" width=\"1280\" height=\"360\" /\u003e\r\n\r\n\u003c%-- Resize an image to the desired with and height --%\u003e\r\n\u003cfocuspoints:resize var=\"imageResized1280x360\" url=\"https://path/to/my/image\" filename=\"my-image.jpg\" width=\"1280\" height=\"360\" /\u003e\r\n```\r\n\r\n## Thymeleaf\r\n\r\nAdd the following dependency to your projetc\r\n\r\n```xml\r\n\u003cdependency\u003e\r\n\t\u003cgroupId\u003eio.focuspoints\u003c/groupId\u003e\r\n\t\u003cartifactId\u003efocuspoints-client-thymeleaf\u003c/artifactId\u003e\r\n\t\u003cversion\u003e1.0.1\u003c/version\u003e\r\n\u003c/dependency\u003e\r\n```\r\n\r\nThis will provide a io.focuspoints.client.thymeleaf.FocusPointsDialect that needs to be configured with the Thymeleaf Engine\r\n\r\n```java\r\nTemplateEngine templateEngine = new TemplateEngine();\r\ntemplateEngine.addDialect(new FocusPointsDialect());\r\n```\r\n\r\nFor those using Spring Boot you can simply define it as a Bean in you applciation context\r\n\r\n```java\r\n@Bean\r\npublic LayoutDialect focusPointsDialect() {\r\n    return new FocusPointsDialect();\r\n}\r\n```\r\n\r\nThis will add the `#focuspoints` object with the following functions\r\n\r\n```java\r\n${#focuspoints.transform(url, filename, width, height)}\r\n${#focuspoints.transform(url, filename, width, height, focusPointX, focusPointY)}\r\n\r\n${#focuspoints.resize(url, filename, width, height)}\r\n```\r\n\r\n### The transformation operation\r\n\r\nThe transformation operation generates a URL containing the correct parameters for transforming an image using the desired parameters. The images created by the transformation operation always matches the desired with and height. When it is required to crop certain parts of the image the focus point coordinate is used to determin which part of the image must not be removed.\r\n\r\n| Parameter   | Description |\r\n|-------------|-------------|\r\n| url         | An absolute URL of the image that is used. |\r\n| filename    | The filename of the image. |\r\n| width       | The desired width of the generated image variant in pixels. Must be a positive `Integer` value |\r\n| height      | The desired height of the generated image variant in pixels. Must be a positive `Integer` value |\r\n| focusPointX | The focus point coordinate for the x-axis. Must be a `Double` value between -1 and 1. |\r\n| focusPointY | The focus point coordinate for the y-axis. Must be a `Double` value between -1 and 1. |\r\n\r\n### The resize operation\r\n\r\nThe resize operation generates a URL containing the correct parameters for resizing an image using the desired parameters. Where the image transformation tag can crop certain parts of an image this is not always desired (e.g. when displaying a company logo). The resize operation makes sure the image fits within the desired dimensions but only fits the longest side of the image. The shortest side could therefor be smaller than the provided with or height.\r\n\r\n| Attribute | Description |\r\n|-----------|-------------|\r\n| url       | An absolute URL of the image that is used. |\r\n| filename  | The filename of the image. |\r\n| width     | The desired width of the generated image variant in pixels. Must be a positive `Integer` value |\r\n| height    | The desired height of the generated image variant in pixels. Must be a positive `Integer` value |\r\n\r\n# Serving images from your own domain\r\nWhen using FocusPoints the domain your images are services from will be `images.focuspoints.io`. If this is undesirable behavior it is possible to serve the images from your own domain by using a proxy. In order to so use the following steps:\r\n1. Set the FocusPoints URL in the configuration to a relative path (e.g. `/images/`). Either do so by setting it on `ImageServiceConfigurationProperties` or through the configuration property `focuspoints.url` depending on which configuration you use.\r\n2. Create a proxy pass in order to proxy all requests for the `/images/` path to `https://images.focuspoints.io`. An example using Apache HTTPD can be found below\r\n\r\n```xml\r\n\u003cLocation \"/images/\"\u003e\r\n\tProxyPass \"https://images.focuspoints.io\"\r\n\u003c/Location\u003e\r\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffocus-points%2Ffocuspoints-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffocus-points%2Ffocuspoints-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffocus-points%2Ffocuspoints-client/lists"}