{"id":19805888,"url":"https://github.com/shekhargulati/image-resolver","last_synced_at":"2025-05-01T06:31:35.246Z","repository":{"id":57727065,"uuid":"79242616","full_name":"shekhargulati/image-resolver","owner":"shekhargulati","description":"A Java 8 library to extract main image from a URL or website link","archived":false,"fork":false,"pushed_at":"2019-10-19T09:29:06.000Z","size":206,"stargazers_count":23,"open_issues_count":1,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-06T10:51:52.245Z","etag":null,"topics":["extract-images","image","java-8"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shekhargulati.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":"2017-01-17T15:39:29.000Z","updated_at":"2022-12-15T09:45:28.000Z","dependencies_parsed_at":"2022-09-15T01:33:18.812Z","dependency_job_id":null,"html_url":"https://github.com/shekhargulati/image-resolver","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shekhargulati%2Fimage-resolver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shekhargulati%2Fimage-resolver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shekhargulati%2Fimage-resolver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shekhargulati%2Fimage-resolver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shekhargulati","download_url":"https://codeload.github.com/shekhargulati/image-resolver/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251835753,"owners_count":21651705,"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":["extract-images","image","java-8"],"created_at":"2024-11-12T09:05:38.944Z","updated_at":"2025-05-01T06:31:34.927Z","avatar_url":"https://github.com/shekhargulati.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"image-resolver [![Build Status](https://travis-ci.org/shekhargulati/image-resolver.svg?branch=master)](https://travis-ci.org/shekhargulati/image-resolver) [![codecov.io](https://codecov.io/github/shekhargulati/image-resolver/coverage.svg?branch=master)](https://codecov.io/github/shekhargulati/image-resolver?branch=master) [![License](https://img.shields.io/:license-apache-blue.svg)](./LICENSE)\n------\n\nA Java 8 library to extract main image from a URL. \nGetting Started\n--------\n\nTo use image-resolver in your application, you have to add `image-resolver` in your classpath. image-resolver is available on [Maven Central](http://search.maven.org/) so you just need to add dependency to your favorite build tool as show below.\n\nFor Apache Maven users, please add following to your pom.xml.\n\n```xml\n\u003cdependencies\u003e\n    \u003cdependency\u003e\n        \u003cgroupId\u003ecom.shekhargulati\u003c/groupId\u003e\n        \u003cartifactId\u003eimage-resolver\u003c/artifactId\u003e\n        \u003cversion\u003e0.1.0\u003c/version\u003e\n    \u003c/dependency\u003e\n\u003c/dependencies\u003e\n```\n\nGradle users can add following to their build.gradle file.\n\n```\ncompile(group: 'com.shekhargulati', name: 'image-resolver', version: '0.1.0')\n```\n\n## Using the API\n\nIt is very easy to use the API.\n\n### Extracting image from URL.\n\n```java\nString url = \"https://medium.com/the-mission/how-to-get-people-to-like-you-in-5-seconds-or-less-67e64cb91155#.tp52bdm6m\";\nOptional\u003cString\u003e mainImage = MainImageResolver.resolveMainImage(url);\n// Return  Optional(\"https://cdn-images-1.medium.com/max/1200/1*-yql2CobEo8rGLCZv2gOyw.jpeg\")\n```\n\n### Extracting image from HTML\n\n```java\nOptional\u003cString\u003e mainImage = MainImageResolver.resolveMainImageFromHtml(html)\n```\n\n### Extracting image using your HTML fetcher\n\nIf you want to use your own way to fetch HTML then you can use.\n\n```java\nOptional\u003cString\u003e mainImage = MainImageResolver.resolveMainImage(url, url -\u003e fetchHtml(), ImageResolvers.webpageResolvers);\n```\n\n## Inspiration\n\nThis library is inspired by Maurice Svay [ImageResolver](https://github.com/mauricesvay/ImageResolver) JavaScript library.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshekhargulati%2Fimage-resolver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshekhargulati%2Fimage-resolver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshekhargulati%2Fimage-resolver/lists"}