Skip to content

Commit

Permalink
added bmp and ico image format to all parser/viewing methods
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3969 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
orbiter committed Jul 15, 2007
1 parent 5444b07 commit 26ddf79
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 7 deletions.
3 changes: 2 additions & 1 deletion htroot/CacheAdmin_p.java
Expand Up @@ -142,7 +142,8 @@ public static serverObjects respond(httpHeader header, serverObjects post, serve
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 {
Expand Down
2 changes: 1 addition & 1 deletion htroot/htdocsdefault/dir.java
Expand Up @@ -291,7 +291,7 @@ public static serverObjects respond(httpHeader header, serverObjects post, serve
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);
Expand Down
2 changes: 1 addition & 1 deletion source/de/anomic/http/httpd.java
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion source/de/anomic/plasma/plasmaParser.java
Expand Up @@ -175,7 +175,7 @@ public boolean accept(File file) {
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
Expand Down
4 changes: 3 additions & 1 deletion source/de/anomic/plasma/plasmaURL.java
Expand Up @@ -667,10 +667,12 @@ public static final void decompressIndex(TreeMap target, serverByteBuffer ci, St

// 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; }
Expand Down
2 changes: 1 addition & 1 deletion source/de/anomic/ymage/ymageImageParser.java
Expand Up @@ -24,7 +24,7 @@ public static final Image parse(String filename, byte[] source) {
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);
}

Expand Down
2 changes: 1 addition & 1 deletion yacy.init
Expand Up @@ -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
Expand Down

0 comments on commit 26ddf79

Please sign in to comment.