diff options
author | Andrew Dolgov <[email protected]> | 2015-07-08 16:50:18 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2015-07-08 16:50:18 +0300 |
commit | 3599b91766d36d1a2d9701a5330bff946a0e3cae (patch) | |
tree | 67133f230b836d4ea02b3fb144a31935fcc3fcea | |
parent | 8207b3a1f87c1b3c01debbddd985f73020b0db99 (diff) |
minor thumbnail fixes
-rwxr-xr-x | org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesFragment.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesFragment.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesFragment.java index 534f2832..557e5cb8 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesFragment.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesFragment.java @@ -860,20 +860,30 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener, if (showFlavorImage && article.flavorImage == null) { Elements imgs = article.articleDoc.select("img"); + Element firstImg = null; for (Element tmp : imgs) { try { + if (tmp.attr("src") != null && tmp.attr("src").indexOf("data:") == 0) { + continue; + } + + if (firstImg != null) firstImg = tmp; + if (Integer.valueOf(tmp.attr("width")) > FLAVOR_IMG_MIN_WIDTH && Integer.valueOf(tmp.attr("width")) > FLAVOR_IMG_MIN_HEIGHT) { article.flavorImage = tmp; break; } + } catch (NumberFormatException e) { // } } + Log.d(TAG, "" + firstImg); + if (article.flavorImage == null) - article.flavorImage = imgs.first(); + article.flavorImage = firstImg; } if (holder.textImage != null) { |