+ /**
+ * Extract an image link from the point description
+ * @param inDesc description tag contents
+ * @return image link if found or null
+ */
+ private static String getImgLink(String inDesc)
+ {
+ if (inDesc == null || inDesc.equals("")) {return null;}
+ // Pull out <img tag from description (if any)
+ int spos = inDesc.indexOf("<img");
+ int epos = inDesc.indexOf('>', spos + 10);
+ if (spos < 0 || epos < 0) return null;
+ String imgtag = inDesc.substring(spos + 4, epos);
+ // Find the src attribute from img tag
+ int quotepos = imgtag.toLowerCase().indexOf("src=");
+ if (quotepos < 0) return null;
+ // source may be quoted with single or double quotes
+ char quotechar = imgtag.charAt(quotepos + 4);
+ int equotepos = imgtag.indexOf(quotechar, quotepos + 7);
+ if (equotepos < 0) return null;
+ return imgtag.substring(quotepos + 5, equotepos);
+ }