Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

added bmp and ico image format to all parser/viewing methods

orbiter26ddf797eb74
diff --git a/htroot/CacheAdmin_p.java b/htroot/CacheAdmin_p.java
index 8f0494c2b..8d15446d9 100644
--- a/htroot/CacheAdmin_p.java
+++ b/htroot/CacheAdmin_p.java
@@ -142,7 +142,8 @@ public class CacheAdmin_p {
final int dotpos = ff.lastIndexOf('.');
final String ext = (dotpos >= 0) ? ff.substring(dotpos + 1).toLowerCase() : "";
if (ext.equals("gif") || ext.equals("jpg") ||
- ext.equals("png") || ext.equals("jpeg")) {
+ ext.equals("png") || ext.equals("jpeg") ||
+ ext.equals("ico") || ext.equals("bmp")) {
prop.put("info_type", Image);
prop.put("info_type_src", pathString);
} else {
diff --git a/htroot/htdocsdefault/dir.java b/htroot/htdocsdefault/dir.java
index 613d9a70e..def69100a 100644
--- a/htroot/htdocsdefault/dir.java
+++ b/htroot/htdocsdefault/dir.java
@@ -291,7 +291,7 @@ public class dir {
prop.putSafeXML("dirlist_" + fileIdx + "_dir_URL","http://" + yacyCore.seedDB.mySeed.getPublicAddress() + path + fileName + "/");
} else {
// determine if we should display the description string or a preview image
- boolean showImage = /* (description.length() == 0) && */ (fileName.endsWith(".jpg") || fileName.endsWith(".gif") || fileName.endsWith(".png"));
+ boolean showImage = /* (description.length() == 0) && */ (fileName.endsWith(".jpg") || fileName.endsWith(".gif") || fileName.endsWith(".png") || fileName.endsWith(".ico") || fileName.endsWith(".bmp"));
// the entry is a file
prop.put("dirlist_" + fileIdx + "_dir" , 0);
diff --git a/source/de/anomic/http/httpd.java b/source/de/anomic/http/httpd.java
index 57d0fb213..d1488f48e 100644
--- a/source/de/anomic/http/httpd.java
+++ b/source/de/anomic/http/httpd.java
@@ -108,7 +108,7 @@ public final class httpd implements serverHandler {
//TODO: Load this from a file
private static final HashSet disallowZippedContentEncoding = new HashSet(Arrays.asList(new String[]{
- ".gz", ".tgz", ".jpg", ".jpeg", ".gif", ".zip", ".rar", ".bz2", ".lha", ".jar", ".rpm", ".arc", ".arj", ".wmv"
+ ".gz", ".tgz", ".jpg", ".jpeg", ".gif", ".zip", ".rar", ".bz2", ".lha", ".jar", ".rpm", ".arc", ".arj", ".wmv", ".png", ".ico", ".bmp"
}));
// static objects
diff --git a/source/de/anomic/plasma/plasmaParser.java b/source/de/anomic/plasma/plasmaParser.java
index a0e5e4d1d..68feb2397 100644
--- a/source/de/anomic/plasma/plasmaParser.java
+++ b/source/de/anomic/plasma/plasmaParser.java
@@ -175,7 +175,7 @@ public final class plasmaParser {
String apps = "sit,hqx,img,dmg,exe,com,bat,sh,vbs,zip,jar";
String audio = "mp2,mp3,ogg,aac,aif,aiff,wav";
String video = "swf,avi,wmv,rm,mov,mpg,mpeg,ram,m4v";
- String image = "jpg,jpeg,jpe,gif,png";
+ String image = "jpg,jpeg,jpe,gif,png,ico,bmp";
initMediaExt(extString2extList(
apps + "," + // application container
"tar,gz,bz2,arj,zip,rar," + // archive formats
diff --git a/source/de/anomic/plasma/plasmaURL.java b/source/de/anomic/plasma/plasmaURL.java
index e4fc7b257..c21389299 100644
--- a/source/de/anomic/plasma/plasmaURL.java
+++ b/source/de/anomic/plasma/plasmaURL.java
@@ -667,10 +667,12 @@ public class plasmaURL {
// doctype calculation
public static char docType(URL url) {
- String path = url.getPath();
+ String path = url.getPath().toLowerCase();
// serverLog.logFinest("PLASMA", "docType URL=" + path);
char doctype = DT_UNKNOWN;
if (path.endsWith(".gif")) { doctype = DT_IMAGE; }
+ else if (path.endsWith(".ico")) { doctype = DT_IMAGE; }
+ else if (path.endsWith(".bmp")) { doctype = DT_IMAGE; }
else if (path.endsWith(".jpg")) { doctype = DT_IMAGE; }
else if (path.endsWith(".jpeg")) { doctype = DT_IMAGE; }
else if (path.endsWith(".png")) { doctype = DT_IMAGE; }
diff --git a/source/de/anomic/ymage/ymageImageParser.java b/source/de/anomic/ymage/ymageImageParser.java
index 5439cf825..60c63b762 100644
--- a/source/de/anomic/ymage/ymageImageParser.java
+++ b/source/de/anomic/ymage/ymageImageParser.java
@@ -24,7 +24,7 @@ public class ymageImageParser {
image = icoparser.getImage(0);
if (image == null) return null;
} else {
- // awt can handle jpg, bmp and gif formats, try it
+ // awt can handle jpg, png and gif formats, try it
image = Toolkit.getDefaultToolkit().createImage(source);
}
diff --git a/yacy.init b/yacy.init
index 828271248..3b31323df 100644
--- a/yacy.init
+++ b/yacy.init
@@ -225,7 +225,7 @@ parseableMimeTypes.URLREDIRECTOR=
# a comma-separated list of extensions that denote media file formats
# this is important to recognize <a href> - tags as not-html reference
# These files will be excluded from indexing _(Please keep extensions in alphabetical order)_
-mediaExt=7z,ace,aif,aiff,arj,asf,asx,avi,bin,bz2,css,db,dcm,deb,doc,dll,dmg,exe,gif,gz,hqx,ico,img,iso,jar,jpe,jpg,jpeg,lx,lxl,m4v,mpeg,mov,mp3,mpg,ogg,png,pdf,ppt,ps,ram,rar,rm,rpm,scr,sit,so,swf,sxc,sxd,sxi,sxw,tar,tbz,tgz,torrent,war,wav,wmv,xcf,xls,zip
+mediaExt=7z,ace,aif,aiff,arj,asf,asx,avi,bin,bmp,bz2,css,db,dcm,deb,doc,dll,dmg,exe,gif,gz,hqx,ico,img,iso,jar,jpe,jpg,jpeg,lx,lxl,m4v,mpeg,mov,mp3,mpg,ogg,png,pdf,ppt,ps,ram,rar,rm,rpm,scr,sit,so,swf,sxc,sxd,sxi,sxw,tar,tbz,tgz,torrent,war,wav,wmv,xcf,xls,zip
parseableExt=html,htm,txt,php,shtml,asp,aspx,jsp
# Promotion Strings