This repository has been archived by the owner on Dec 2, 2019. It is now read-only.
Enhancements to image resolution capabilities #32
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently sharing an image URL that does not end in a file extension (e.g. https://cdn.shopify.com/s/files/1/1400/5075/files/website_logo2_720x_6cdc3363-fec0-4d60-a5bd-5236869352bf_720x.png?v=1533741874) results in a failed preview rather than pulling back the correct image.
This occurs because these URLs do not match the regex used in isImage(). This results in an attempt by JSoup to process the image as an HTML document which results in an exception due to a check on the response mime type. I added code to detect this error and process the url as if it were an image if the returned mimetype is an image.
I also updated the project to work with the newest Android Studio version and refactored DefaultImagePickingStrategy so that subclasses of BaseImagePickingStrategy can reuse the code for getting the image url from the meta tags and/or from scraping the HTML document.
The sample app was also updated to refer to the library project rather than pull the release artifact.