Skip to content
This repository has been archived by the owner on Dec 2, 2019. It is now read-only.

Enhancements to image resolution capabilities #32

Merged
merged 3 commits into from Aug 30, 2018

Conversation

jdonmoyer
Copy link
Contributor

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.

@LeonardoCardoso LeonardoCardoso merged commit 1d9aedc into LeonardoCardoso:master Aug 30, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants