Merge branch 'master' of https://github.com/luccioman/yacy_search_server
@ -1,95 +1,103 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="source"/>
|
||||
<classpathentry excluding="api/|env/|processing/domaingraph/applet/|yacy/|api/bookmarks/|api/ymarks/|api/bookmarks/posts/|api/bookmarks/tags/|api/bookmarks/xbel/|solr/|gsa/|solr/collection1/|api/blacklists/" kind="src" path="htroot"/>
|
||||
<classpathentry excluding="bookmarks/|ymarks/|bookmarks/posts/|bookmarks/tags/|bookmarks/xbel/|blacklists/" kind="src" path="htroot/api"/>
|
||||
<classpathentry kind="src" path="htroot/env"/>
|
||||
<classpathentry kind="src" path="htroot/yacy"/>
|
||||
<classpathentry excluding="posts/|tags/|xbel/" kind="src" path="htroot/api/bookmarks"/>
|
||||
<classpathentry kind="src" path="htroot/api/ymarks"/>
|
||||
<classpathentry kind="src" path="htroot/api/bookmarks/posts"/>
|
||||
<classpathentry kind="src" path="htroot/api/bookmarks/tags"/>
|
||||
<classpathentry kind="src" path="htroot/api/bookmarks/xbel"/>
|
||||
<classpathentry kind="src" path="htroot/api/blacklists"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="lib" path="lib/commons-logging-1.2.jar"/>
|
||||
<classpathentry kind="lib" path="lib/J7Zip-modified.jar"/>
|
||||
<classpathentry kind="lib" path="lib/webcat-0.1-swf.jar"/>
|
||||
<classpathentry kind="lib" path="lib/commons-jxpath-1.3.jar"/>
|
||||
<classpathentry kind="lib" path="lib/jsch-0.1.53.jar"/>
|
||||
<classpathentry kind="lib" path="lib/jakarta-oro-2.0.8.jar"/>
|
||||
<classpathentry kind="lib" path="lib/apache-mime4j-0.6.jar"/>
|
||||
<classpathentry kind="lib" path="lib/commons-fileupload-1.3.1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/json-simple-1.1.1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/xercesImpl.jar"/>
|
||||
<classpathentry kind="lib" path="lib/xml-apis.jar"/>
|
||||
<classpathentry kind="lib" path="lib/commons-compress-1.9.jar"/>
|
||||
<classpathentry kind="lib" path="lib/commons-lang-2.6.jar"/>
|
||||
<classpathentry kind="lib" path="lib/jaudiotagger-2.0.4-20111207.115108-15.jar"/>
|
||||
<classpathentry kind="lib" path="lib/commons-codec-1.10.jar"/>
|
||||
<classpathentry kind="lib" path="lib/jcl-over-slf4j-1.7.12.jar"/>
|
||||
<classpathentry kind="lib" path="lib/slf4j-jdk14-1.7.12.jar"/>
|
||||
<classpathentry kind="lib" path="lib/log4j-over-slf4j-1.7.12.jar"/>
|
||||
<classpathentry kind="lib" path="lib/httpcore-4.4.1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/metadata-extractor-2.8.1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/xmpcore-5.1.2.jar"/>
|
||||
<classpathentry kind="lib" path="lib/jcifs-1.3.17.jar"/>
|
||||
<classpathentry kind="lib" path="lib/guava-18.0.jar"/>
|
||||
<classpathentry kind="lib" path="lib/spatial4j-0.4.1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/zookeeper-3.4.6.jar"/>
|
||||
<classpathentry kind="lib" path="lib/org.restlet.jar"/>
|
||||
<classpathentry kind="lib" path="lib/fontbox-1.8.10.jar"/>
|
||||
<classpathentry kind="lib" path="lib/jempbox-1.8.10.jar"/>
|
||||
<classpathentry kind="lib" path="lib/pdfbox-1.8.10.jar"/>
|
||||
<classpathentry kind="lib" path="lib/bcmail-jdk15-1.46.jar"/>
|
||||
<classpathentry kind="lib" path="lib/bcprov-jdk15-1.46.jar"/>
|
||||
<classpathentry kind="lib" path="lib/poi-3.13-20150929.jar"/>
|
||||
<classpathentry kind="lib" path="lib/poi-scratchpad-3.13-20150929.jar"/>
|
||||
<classpathentry kind="lib" path="lib/commons-io-2.4.jar"/>
|
||||
<classpathentry kind="lib" path="lib/slf4j-api-1.7.12.jar"/>
|
||||
<classpathentry kind="lib" path="lib/chardet.jar"/>
|
||||
<classpathentry kind="lib" path="lib/jetty-client-9.2.11.v20150529.jar"/>
|
||||
<classpathentry kind="lib" path="lib/jetty-continuation-9.2.11.v20150529.jar"/>
|
||||
<classpathentry kind="lib" path="lib/jetty-deploy-9.2.11.v20150529.jar"/>
|
||||
<classpathentry kind="lib" path="lib/jetty-http-9.2.11.v20150529.jar"/>
|
||||
<classpathentry kind="lib" path="lib/jetty-io-9.2.11.v20150529.jar"/>
|
||||
<classpathentry kind="lib" path="lib/jetty-jmx-9.2.11.v20150529.jar"/>
|
||||
<classpathentry kind="lib" path="lib/jetty-proxy-9.2.11.v20150529.jar"/>
|
||||
<classpathentry kind="lib" path="lib/jetty-security-9.2.11.v20150529.jar"/>
|
||||
<classpathentry kind="lib" path="lib/jetty-server-9.2.11.v20150529.jar"/>
|
||||
<classpathentry kind="lib" path="lib/jetty-servlet-9.2.11.v20150529.jar"/>
|
||||
<classpathentry kind="lib" path="lib/jetty-servlets-9.2.11.v20150529.jar"/>
|
||||
<classpathentry kind="lib" path="lib/jetty-util-9.2.11.v20150529.jar"/>
|
||||
<classpathentry kind="lib" path="lib/jetty-webapp-9.2.11.v20150529.jar"/>
|
||||
<classpathentry kind="lib" path="lib/jetty-xml-9.2.11.v20150529.jar"/>
|
||||
<classpathentry kind="lib" path="lib/httpclient-4.5.jar"/>
|
||||
<classpathentry kind="lib" path="lib/httpmime-4.5.jar"/>
|
||||
<classpathentry kind="lib" path="lib/noggit-0.6.jar"/>
|
||||
<classpathentry kind="lib" path="lib/solr-core-5.3.1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/solr-solrj-5.3.1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/stax2-api-3.1.4.jar"/>
|
||||
<classpathentry kind="lib" path="lib/woodstox-core-asl-4.4.1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/lucene-analyzers-common-5.3.1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/lucene-analyzers-phonetic-5.3.1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/lucene-classification-5.3.1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/lucene-codecs-5.3.1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/lucene-core-5.3.1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/lucene-facet-5.3.1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/lucene-grouping-5.3.1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/lucene-highlighter-5.3.1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/lucene-join-5.3.1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/lucene-memory-5.3.1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/lucene-misc-5.3.1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/lucene-queries-5.3.1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/lucene-queryparser-5.3.1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/lucene-spatial-5.3.1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/lucene-suggest-5.3.1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/lucene-backward-codecs-5.3.1.jar"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
|
||||
<classpathentry kind="lib" path="lib/icu4j-55_1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/htmllexer.jar"/>
|
||||
<classpathentry kind="lib" path="lib/jsoup-1.8.3.jar"/>
|
||||
<classpathentry kind="lib" path="lib/javax.servlet-api-3.1.0.jar"/>
|
||||
<classpathentry kind="lib" path="lib/weupnp-0.1.3.jar"/>
|
||||
<classpathentry kind="output" path="gen"/>
|
||||
</classpath>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="source"/>
|
||||
<classpathentry kind="src" path="test"/>
|
||||
<classpathentry excluding="api/|env/|processing/domaingraph/applet/|yacy/|api/bookmarks/|api/ymarks/|api/bookmarks/posts/|api/bookmarks/tags/|api/bookmarks/xbel/|solr/|gsa/|solr/collection1/|api/blacklists/" kind="src" path="htroot"/>
|
||||
<classpathentry excluding="bookmarks/|ymarks/|bookmarks/posts/|bookmarks/tags/|bookmarks/xbel/|blacklists/" kind="src" path="htroot/api"/>
|
||||
<classpathentry kind="src" path="htroot/env"/>
|
||||
<classpathentry kind="src" path="htroot/yacy"/>
|
||||
<classpathentry excluding="posts/|tags/|xbel/" kind="src" path="htroot/api/bookmarks"/>
|
||||
<classpathentry kind="src" path="htroot/api/ymarks"/>
|
||||
<classpathentry kind="src" path="htroot/api/bookmarks/posts"/>
|
||||
<classpathentry kind="src" path="htroot/api/bookmarks/tags"/>
|
||||
<classpathentry kind="src" path="htroot/api/bookmarks/xbel"/>
|
||||
<classpathentry kind="src" path="htroot/api/blacklists"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="lib" path="lib/commons-logging-1.2.jar"/>
|
||||
<classpathentry kind="lib" path="lib/J7Zip-modified.jar"/>
|
||||
<classpathentry kind="lib" path="lib/webcat-0.1-swf.jar"/>
|
||||
<classpathentry kind="lib" path="lib/commons-jxpath-1.3.jar"/>
|
||||
<classpathentry kind="lib" path="lib/jsch-0.1.53.jar"/>
|
||||
<classpathentry kind="lib" path="lib/jakarta-oro-2.0.8.jar"/>
|
||||
<classpathentry kind="lib" path="lib/apache-mime4j-0.6.jar"/>
|
||||
<classpathentry kind="lib" path="lib/commons-fileupload-1.3.1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/json-simple-1.1.1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/xercesImpl.jar"/>
|
||||
<classpathentry kind="lib" path="lib/xml-apis.jar"/>
|
||||
<classpathentry kind="lib" path="lib/commons-compress-1.9.jar"/>
|
||||
<classpathentry kind="lib" path="lib/commons-lang-2.6.jar"/>
|
||||
<classpathentry kind="lib" path="lib/jaudiotagger-2.0.4-20111207.115108-15.jar"/>
|
||||
<classpathentry kind="lib" path="lib/commons-codec-1.10.jar"/>
|
||||
<classpathentry kind="lib" path="lib/jcl-over-slf4j-1.7.12.jar"/>
|
||||
<classpathentry kind="lib" path="lib/slf4j-jdk14-1.7.12.jar"/>
|
||||
<classpathentry kind="lib" path="lib/log4j-over-slf4j-1.7.12.jar"/>
|
||||
<classpathentry kind="lib" path="lib/httpcore-4.4.1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/metadata-extractor-2.8.1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/xmpcore-5.1.2.jar"/>
|
||||
<classpathentry kind="lib" path="lib/jcifs-1.3.17.jar"/>
|
||||
<classpathentry kind="lib" path="lib/guava-18.0.jar"/>
|
||||
<classpathentry kind="lib" path="lib/spatial4j-0.4.1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/zookeeper-3.4.6.jar"/>
|
||||
<classpathentry kind="lib" path="lib/org.restlet.jar"/>
|
||||
<classpathentry kind="lib" path="lib/fontbox-1.8.10.jar"/>
|
||||
<classpathentry kind="lib" path="lib/jempbox-1.8.10.jar"/>
|
||||
<classpathentry kind="lib" path="lib/pdfbox-1.8.10.jar"/>
|
||||
<classpathentry kind="lib" path="lib/bcmail-jdk15-1.46.jar"/>
|
||||
<classpathentry kind="lib" path="lib/bcprov-jdk15-1.46.jar"/>
|
||||
<classpathentry kind="lib" path="lib/poi-3.13-20150929.jar"/>
|
||||
<classpathentry kind="lib" path="lib/poi-scratchpad-3.13-20150929.jar"/>
|
||||
<classpathentry kind="lib" path="lib/commons-io-2.4.jar"/>
|
||||
<classpathentry kind="lib" path="lib/slf4j-api-1.7.12.jar"/>
|
||||
<classpathentry kind="lib" path="lib/chardet.jar"/>
|
||||
<classpathentry kind="lib" path="lib/jetty-client-9.2.11.v20150529.jar"/>
|
||||
<classpathentry kind="lib" path="lib/jetty-continuation-9.2.11.v20150529.jar"/>
|
||||
<classpathentry kind="lib" path="lib/jetty-deploy-9.2.11.v20150529.jar"/>
|
||||
<classpathentry kind="lib" path="lib/jetty-http-9.2.11.v20150529.jar"/>
|
||||
<classpathentry kind="lib" path="lib/jetty-io-9.2.11.v20150529.jar"/>
|
||||
<classpathentry kind="lib" path="lib/jetty-jmx-9.2.11.v20150529.jar"/>
|
||||
<classpathentry kind="lib" path="lib/jetty-proxy-9.2.11.v20150529.jar"/>
|
||||
<classpathentry kind="lib" path="lib/jetty-security-9.2.11.v20150529.jar"/>
|
||||
<classpathentry kind="lib" path="lib/jetty-server-9.2.11.v20150529.jar"/>
|
||||
<classpathentry kind="lib" path="lib/jetty-servlet-9.2.11.v20150529.jar"/>
|
||||
<classpathentry kind="lib" path="lib/jetty-servlets-9.2.11.v20150529.jar"/>
|
||||
<classpathentry kind="lib" path="lib/jetty-util-9.2.11.v20150529.jar"/>
|
||||
<classpathentry kind="lib" path="lib/jetty-webapp-9.2.11.v20150529.jar"/>
|
||||
<classpathentry kind="lib" path="lib/jetty-xml-9.2.11.v20150529.jar"/>
|
||||
<classpathentry kind="lib" path="lib/httpclient-4.5.jar"/>
|
||||
<classpathentry kind="lib" path="lib/httpmime-4.5.jar"/>
|
||||
<classpathentry kind="lib" path="lib/noggit-0.6.jar"/>
|
||||
<classpathentry kind="lib" path="lib/solr-core-5.3.1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/solr-solrj-5.3.1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/stax2-api-3.1.4.jar"/>
|
||||
<classpathentry kind="lib" path="lib/woodstox-core-asl-4.4.1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/lucene-analyzers-common-5.3.1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/lucene-analyzers-phonetic-5.3.1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/lucene-classification-5.3.1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/lucene-codecs-5.3.1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/lucene-core-5.3.1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/lucene-facet-5.3.1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/lucene-grouping-5.3.1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/lucene-highlighter-5.3.1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/lucene-join-5.3.1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/lucene-memory-5.3.1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/lucene-misc-5.3.1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/lucene-queries-5.3.1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/lucene-queryparser-5.3.1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/lucene-spatial-5.3.1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/lucene-suggest-5.3.1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/lucene-backward-codecs-5.3.1.jar"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
|
||||
<classpathentry kind="lib" path="lib/icu4j-55_1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/htmllexer.jar"/>
|
||||
<classpathentry kind="lib" path="lib/jsoup-1.8.3.jar"/>
|
||||
<classpathentry kind="lib" path="lib/javax.servlet-api-3.1.0.jar"/>
|
||||
<classpathentry kind="lib" path="lib/weupnp-0.1.3.jar"/>
|
||||
<classpathentry kind="lib" path="lib/common-image-3.1.2.jar"/>
|
||||
<classpathentry kind="lib" path="lib/common-io-3.1.2.jar"/>
|
||||
<classpathentry kind="lib" path="lib/common-lang-3.1.2.jar"/>
|
||||
<classpathentry kind="lib" path="lib/imageio-core-3.1.2.jar"/>
|
||||
<classpathentry kind="lib" path="lib/imageio-metadata-3.1.2.jar"/>
|
||||
<classpathentry kind="lib" path="lib/imageio-tiff-3.1.2.jar"/>
|
||||
<classpathentry kind="lib" path="lib/servlet-3.1.2.jar"/>
|
||||
<classpathentry kind="output" path="gen"/>
|
||||
</classpath>
|
||||
|
@ -0,0 +1,171 @@
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.URL;
|
||||
|
||||
import net.yacy.cora.util.ConcurrentLog;
|
||||
import net.yacy.peers.graphics.EncodedImage;
|
||||
import net.yacy.server.serverObjects;
|
||||
|
||||
// ViewImagePerfTest.java
|
||||
// -----------------------
|
||||
// part of YaCy
|
||||
// (C) by Michael Peter Christen; mc@yacy.net
|
||||
// first published on http://www.anomic.de
|
||||
// Frankfurt, Germany, 2006
|
||||
// created 03.04.2006
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation; either version 2 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
/**
|
||||
* Test to measure image render performance by ViewImage
|
||||
*
|
||||
* @author luc
|
||||
*
|
||||
*/
|
||||
public class ViewImagePerfTest {
|
||||
|
||||
/** Default image */
|
||||
private static final String DEFAULT_IMG_RESOURCE = "/viewImageTest/test/JPEG_example_JPG_RIP_100.jpg";
|
||||
|
||||
/** Default render max width (JPEG_example_JPG_RIP_100.jpg width / 10) */
|
||||
private static final int DEFAULT_MAX_WIDTH = 31;
|
||||
|
||||
/** Default render max height (JPEG_example_JPG_RIP_100.jpg height / 10) */
|
||||
private static final int DEFAULT_MAX_HEIGHT = 23;
|
||||
|
||||
/** Default encoding format */
|
||||
private static final String DEFAUL_EXT = "png";
|
||||
|
||||
/**
|
||||
* @param testFile
|
||||
* file to load
|
||||
* @return testFile content as a bytes array
|
||||
* @throws IOException
|
||||
* when an error occured while loading
|
||||
*/
|
||||
private static byte[] getBytes(File testFile) throws IOException {
|
||||
InputStream inStream = new FileInputStream(testFile);
|
||||
byte[] res = new byte[inStream.available()];
|
||||
try {
|
||||
inStream.read(res);
|
||||
} finally {
|
||||
inStream.close();
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param args
|
||||
* first item may contain file URL
|
||||
* @return file to be used : specified as first in args or default one
|
||||
*/
|
||||
private static File getTestFile(String args[]) {
|
||||
String fileURL;
|
||||
if (args != null && args.length > 0) {
|
||||
fileURL = args[0];
|
||||
} else {
|
||||
URL defaultURL = ViewImagePerfTest.class.getResource(DEFAULT_IMG_RESOURCE);
|
||||
if (defaultURL == null) {
|
||||
throw new IllegalArgumentException("File not found : " + DEFAULT_IMG_RESOURCE);
|
||||
}
|
||||
fileURL = defaultURL.getFile();
|
||||
}
|
||||
return new File(fileURL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Build post parameters to used with ViewImage
|
||||
*
|
||||
* @param args
|
||||
* main parameters : second and third items may respectively
|
||||
* contain max width and max height
|
||||
* @return a serverObjects instance
|
||||
*/
|
||||
private static serverObjects makePostParams(String args[]) {
|
||||
serverObjects post = new serverObjects();
|
||||
int maxWidth = DEFAULT_MAX_WIDTH;
|
||||
if (args != null && args.length > 1) {
|
||||
maxWidth = Integer.parseInt(args[1]);
|
||||
}
|
||||
post.put("maxwidth", String.valueOf(maxWidth));
|
||||
|
||||
int maxHeight = DEFAULT_MAX_HEIGHT;
|
||||
if (args != null && args.length > 2) {
|
||||
maxHeight = Integer.parseInt(args[2]);
|
||||
}
|
||||
post.put("maxheight", String.valueOf(maxHeight));
|
||||
/* Make it square by default */
|
||||
post.put("quadratic", "");
|
||||
return post;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param args
|
||||
* main parameters : fourth item may contain extension
|
||||
* @return extension to use for encoding
|
||||
*/
|
||||
private static String getEncodingExt(String args[]) {
|
||||
String ext = DEFAUL_EXT;
|
||||
if (args != null && args.length > 3) {
|
||||
ext = args[3];
|
||||
}
|
||||
return ext;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test image (JPEG_example_JPG_RIP_100.jpg) is scaled, and cropped.
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
public static void main(String args[]) throws IOException {
|
||||
File imgFile = getTestFile(args);
|
||||
byte[] resourceb = getBytes(imgFile);
|
||||
String ext = getEncodingExt(args);
|
||||
serverObjects post = makePostParams(args);
|
||||
|
||||
String urlString = imgFile.getAbsolutePath();
|
||||
|
||||
System.out.println("Measuring ViewImage render with file : " + urlString + " encoded To : " + ext);
|
||||
try {
|
||||
/* Max test total time (s) */
|
||||
int maxTotalTime = 20;
|
||||
long beginTime, time, minTime = Long.MAX_VALUE, maxTime = 0, meanTime = 0, totalTime = 0;
|
||||
int step = 0;
|
||||
for (step = 0; (totalTime / 1000000000) < maxTotalTime; step++) {
|
||||
beginTime = System.nanoTime();
|
||||
EncodedImage img = ViewImage.parseAndScale(post, true, urlString, ext, false, resourceb);
|
||||
time = System.nanoTime() - beginTime;
|
||||
minTime = Math.min(minTime, time);
|
||||
maxTime = Math.max(maxTime, time);
|
||||
totalTime += time;
|
||||
if (img == null) {
|
||||
throw new IOException("Image render failed");
|
||||
}
|
||||
}
|
||||
meanTime = totalTime / step;
|
||||
System.out.println("Render total time (ms) : " + (totalTime) / 1000000 + " on " + step + " steps.");
|
||||
System.out.println("Render mean time (ms) : " + (meanTime) / 1000000);
|
||||
System.out.println("Render min time (ms) : " + (minTime) / 1000000);
|
||||
System.out.println("Render max time (ms) : " + (maxTime) / 1000000);
|
||||
} finally {
|
||||
ConcurrentLog.shutdown();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,464 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<style>
|
||||
/* container style for ViewImage render */
|
||||
.thumbcontainer {
|
||||
margin: 2px;
|
||||
width: 128px;
|
||||
height: 128px;
|
||||
float: left;
|
||||
}
|
||||
/* container style for direct browser render */
|
||||
.browserthumb {
|
||||
margin: 2px;
|
||||
width: 128px;
|
||||
height: 128px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
td {
|
||||
max-width: 210px;
|
||||
}
|
||||
</style>
|
||||
<title>ViewImage rendering tests</title>
|
||||
</head>
|
||||
<body>
|
||||
<h2>
|
||||
Test page to check ViewImage rendering with different image formats
|
||||
listed in <a
|
||||
href="http://www.iana.org/assignments/media-types/media-types.xhtml#image"
|
||||
title="IANA Media Types">IANA Media Types page</a>, plus BMP format.
|
||||
</h2>
|
||||
<h3>Prerequisites</h3>
|
||||
<ul>
|
||||
<li>copy /yacy/test/viewImageTest/test folder in
|
||||
/yacy/htroot/env/grafics</li>
|
||||
<li>run a YaCy instance on localhost and 8090 port</li>
|
||||
</ul>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th colspan="2">Render method</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Image format</th>
|
||||
<th>Mime type</th>
|
||||
<th>File name extensions</th>
|
||||
<th>Long name/Description</th>
|
||||
<th>YaCy ViewImage</th>
|
||||
<th>Direct browser</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>PNG : <a
|
||||
href="https://upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonstration_1.png"
|
||||
title="sample source url">sample source</a></td>
|
||||
<td>image/png</td>
|
||||
<td>.png</td>
|
||||
<td>Portable Network Graphics</td>
|
||||
<td>
|
||||
<div class="thumbcontainer">
|
||||
<a
|
||||
href="http://localhost:8090/ViewImage.png?url=http://localhost:8090/env/grafics/test/PNG_transparency_demonstration_1.png"
|
||||
title="ViewImage render PNG sample in full size"> <img
|
||||
src="http://localhost:8090/ViewImage.png?maxwidth=128&maxheight=128&quadratic&url=http://localhost:8090/env/grafics/test/PNG_transparency_demonstration_1.png"
|
||||
width="128" height="128" alt="ViewImage PNG render failed" />
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="browserthumb">
|
||||
<a
|
||||
href="http://localhost:8090/env/grafics/test/PNG_transparency_demonstration_1.png"
|
||||
title="Browser render PNG sample in full size"> <img
|
||||
src="http://localhost:8090/env/grafics/test/PNG_transparency_demonstration_1.png"
|
||||
height="100%" style="margin-left: -17%"
|
||||
alt="Browser PNG render failed" />
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>JPEG : <a
|
||||
href="https://upload.wikimedia.org/wikipedia/commons/b/b4/JPEG_example_JPG_RIP_100.jpg"
|
||||
title="sample source url">sample source</a></td>
|
||||
<td>image/jpeg</td>
|
||||
<td>.jpg, .jpeg, .jpe, .jif, .jfif, .jfi</td>
|
||||
<td>Joint Photographic Experts Group</td>
|
||||
<td>
|
||||
<div class="thumbcontainer">
|
||||
<a
|
||||
href="http://localhost:8090/ViewImage.png?url=http://localhost:8090/env/grafics/test/JPEG_example_JPG_RIP_100.jpg"
|
||||
title="Render JPEG sample in full size"> <img
|
||||
src="http://localhost:8090/ViewImage.png?maxwidth=128&maxheight=128&quadratic&url=http://localhost:8090/env/grafics/test/JPEG_example_JPG_RIP_100.jpg"
|
||||
width="128" height="128" alt="JPG render failed" />
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="browserthumb">
|
||||
<a
|
||||
href="http://localhost:8090/env/grafics/test/JPEG_example_JPG_RIP_100.jpg"
|
||||
title="Render JPEG sample in full size"> <img
|
||||
src="http://localhost:8090/env/grafics/test/JPEG_example_JPG_RIP_100.jpg"
|
||||
height="100%" style="margin-left: -20%" alt="JPG render failed" />
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>GIF : <a
|
||||
href="https://upload.wikimedia.org/wikipedia/commons/a/a0/Sunflower_as_gif_websafe.gif"
|
||||
title="sample source url">sample source</a></td>
|
||||
<td>image/gif</td>
|
||||
<td>.gif</td>
|
||||
<td>Graphics Interchange Format</td>
|
||||
<td>
|
||||
<div class="thumbcontainer">
|
||||
<a
|
||||
href="http://localhost:8090/ViewImage.gif?url=http://localhost:8090/env/grafics/test/Sunflower_as_gif_websafe.gif"
|
||||
title="Render GIF sample in full size"> <img
|
||||
src="http://localhost:8090/ViewImage.gif?maxwidth=128&maxheight=128&quadratic&url=http://localhost:8090/env/grafics/test/Sunflower_as_gif_websafe.gif"
|
||||
width="128" height="128" alt="GIF render failed" />
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="browserthumb">
|
||||
<a
|
||||
href="http://localhost:8090/env/grafics/test/Sunflower_as_gif_websafe.gif"
|
||||
title="Render GIF sample in full size"> <img
|
||||
src="http://localhost:8090/env/grafics/test/Sunflower_as_gif_websafe.gif"
|
||||
width="100%" alt="GIF render failed" />
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Animated GIF : <a
|
||||
href="https://upload.wikimedia.org/wikipedia/commons/2/2c/Rotating_earth_%28large%29.gif"
|
||||
title="sample source url">sample source</a></td>
|
||||
<td>image/gif</td>
|
||||
<td>.gif</td>
|
||||
<td>Graphics Interchange Format</td>
|
||||
<td>
|
||||
<div class="thumbcontainer">
|
||||
<a
|
||||
href="http://localhost:8090/ViewImage.gif?url=http://localhost:8090/env/grafics/test/Rotating_earth_%28large%29.gif"
|
||||
title="Render animated GIF sample in full size"> <img
|
||||
src="http://localhost:8090/ViewImage.gif?maxwidth=128&maxheight=128&quadratic&url=http://localhost:8090/env/grafics/test/Rotating_earth_%28large%29.gif"
|
||||
width="128" height="128" alt="Animated GIF render failed" />
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="browserthumb">
|
||||
<a
|
||||
href="http://localhost:8090/env/grafics/test/Rotating_earth_%28large%29.gif"
|
||||
title="Render animated GIF sample in full size"> <img
|
||||
src="http://localhost:8090/env/grafics/test/Rotating_earth_%28large%29.gif"
|
||||
width="128" height="128" alt="Animated GIF render failed" />
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>SVG : <a
|
||||
href="https://upload.wikimedia.org/wikipedia/commons/0/02/SVG_logo.svg"
|
||||
title="sample source url">sample source</a></td>
|
||||
<td>image/svg+xml</td>
|
||||
<td>.svg, .svgz</td>
|
||||
<td>Scalable Vector Graphics</td>
|
||||
<td>
|
||||
<div class="thumbcontainer">
|
||||
<a
|
||||
href="http://localhost:8090/ViewImage.svg?url=http://localhost:8090/env/grafics/test/SVG_Logo.svg"
|
||||
title="Render SVG sample in full size"> <img
|
||||
src="http://localhost:8090/ViewImage.svg?maxwidth=128&maxheight=128&quadratic&url=http://localhost:8090/env/grafics/test/SVG_Logo.svg"
|
||||
width="128" height="128" alt="SVG render failed" />
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="browserthumb">
|
||||
<a href="http://localhost:8090/env/grafics/test/SVG_Logo.svg"
|
||||
title="Render SVG sample in full size"> <img
|
||||
src="http://localhost:8090/env/grafics/test/SVG_Logo.svg"
|
||||
width="128" height="128" alt="SVG render failed" />
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>ICO : <a href="https://en.wikipedia.org/favicon.ico"
|
||||
title="sample source url">sample source</a></td>
|
||||
<td>image/vnd.microsoft.icon, image/x-icon (not registered at
|
||||
IANA)</td>
|
||||
<td>.ico</td>
|
||||
<td>Graphics file format for computer icons</td>
|
||||
<td>
|
||||
<div class="thumbcontainer">
|
||||
<a
|
||||
href="http://localhost:8090/ViewImage.png?url=http://localhost:8090/env/grafics/test/favicon.ico"
|
||||
title="Render ICO sample in full size"> <img
|
||||
src="http://localhost:8090/ViewImage.png?maxwidth=128&maxheight=128&quadratic&url=http://localhost:8090/env/grafics/test/favicon.ico"
|
||||
width="128" height="128" alt="ICO render failed" />
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="browserthumb">
|
||||
<a href="http://localhost:8090/env/grafics/test/favicon.ico"
|
||||
title="Render ICO sample in full size"> <img
|
||||
src="http://localhost:8090/env/grafics/test/favicon.ico"
|
||||
width="128" height="128" alt="ICO render failed" />
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>BMP : <a
|
||||
href="http://homepages.cae.wisc.edu/~ece533/images/sails.bmp"
|
||||
title="sample source url">sample source</a></td>
|
||||
<td>image/bmp (not registered at IANA), image/x-bmp (not
|
||||
registered at IANA)</td>
|
||||
<td>.bmp, .dib</td>
|
||||
<td>Windows Bitmap</td>
|
||||
<td>
|
||||
<div class="thumbcontainer">
|
||||
<a
|
||||
href="http://localhost:8090/ViewImage.png?url=http://localhost:8090/env/grafics/test/sails.bmp"
|
||||
title="Render BMP sample in full size"> <img
|
||||
src="http://localhost:8090/ViewImage.png?maxwidth=128&maxheight=128&quadratic&url=http://localhost:8090/env/grafics/test/sails.bmp"
|
||||
width="128" height="128" alt="BMP render failed" />
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="browserthumb">
|
||||
<a href="http://localhost:8090/env/grafics/test/sails.bmp"
|
||||
title="Render BMP sample in full size"> <img
|
||||
src="http://localhost:8090/env/grafics/test/sails.bmp"
|
||||
width="128" height="128" alt="BMP render failed" />
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>CGM : <a
|
||||
href="http://www.agocg.ac.uk/train/cgm/ralcgm/sample.cgm"
|
||||
title="sample source url">sample source</a></td>
|
||||
<td>image/cgm</td>
|
||||
<td>.cgm</td>
|
||||
<td>Computer Graphics Metafile</td>
|
||||
<td>
|
||||
<div class="thumbcontainer">
|
||||
<a
|
||||
href="http://localhost:8090/ViewImage.png?url=http://localhost:8090/env/grafics/test/sample.cgm"
|
||||
title="Render CGM sample in full size"> <img
|
||||
src="http://localhost:8090/ViewImage.png?maxwidth=128&maxheight=128&quadratic&url=http://localhost:8090/env/grafics/test/sample.cgm"
|
||||
width="128" height="128" alt="CGM render failed" />
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="browserthumb">
|
||||
<a href="http://localhost:8090/env/grafics/test/sample.cgm"
|
||||
title="Render CGM sample in full size"> <img
|
||||
src="http://localhost:8090/env/grafics/test/sample.cgm"
|
||||
width="128" height="128" alt="CGM render failed" />
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>TIFF : <a
|
||||
href="http://www.uswebsitecreations.com/images/digital_images/marbles.tif"
|
||||
title="sample source url">sample source</a></td>
|
||||
<td>image/tiff, image/tiff-fx</td>
|
||||
<td>.tiff, .tif</td>
|
||||
<td>Tagged Image File Format</td>
|
||||
<td>
|
||||
<div class="thumbcontainer">
|
||||
<a
|
||||
href="http://localhost:8090/ViewImage.png?url=http://localhost:8090/env/grafics/test/marbles.tif"
|
||||
title="Render TIFF sample in full size"> <img
|
||||
src="http://localhost:8090/ViewImage.png?maxwidth=128&maxheight=128&quadratic&url=http://localhost:8090/env/grafics/test/marbles.tif"
|
||||
width="128" height="128" alt="TIFF render failed" />
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="browserthumb">
|
||||
<a href="http://localhost:8090/env/grafics/test/marbles.tif"
|
||||
title="Render TIFF sample in full size"> <img
|
||||
src="http://localhost:8090/env/grafics/test/marbles.tif"
|
||||
width="128" height="128" alt="TIFF render failed" />
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>FITS : <a
|
||||
href="http://fits.gsfc.nasa.gov/samples/WFPC2u5780205r_c0fx.fits"
|
||||
title="sample source url">sample source</a></td>
|
||||
<td>image/fits, application/fits</td>
|
||||
<td>.fits, .fit, .fts</td>
|
||||
<td>Flexible Image Transport System</td>
|
||||
<td>
|
||||
<div class="thumbcontainer">
|
||||
<a
|
||||
href="http://localhost:8090/ViewImage.png?url=WFPC2u5780205r_c0fx.fits"
|
||||
title="Render FITS sample in full size"> <img
|
||||
src="http://localhost:8090/ViewImage.png?maxwidth=128&maxheight=128&quadratic&url=WFPC2u5780205r_c0fx.fits"
|
||||
width="128" height="128" alt="FITS render failed" />
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="browserthumb">
|
||||
<a
|
||||
href="http://localhost:8090/env/grafics/test/WFPC2u5780205r_c0fx.fits"
|
||||
title="Render FITS sample in full size"> <img
|
||||
src="http://localhost:8090/env/grafics/test/WFPC2u5780205r_c0fx.fits"
|
||||
width="128" height="128" alt="FITS render failed" />
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>JPEG 2000 : <a
|
||||
href="http://www.fnordware.com/j2k/relax.jp2"
|
||||
title="sample source url">sample source</a></td>
|
||||
<td>image/jp2, image/jpx, image/jpm, video/mj2</td>
|
||||
<td>.jp2, .j2k, .jpf, .jpx, .jpm, .mj2</td>
|
||||
<td>JPEG 2000</td>
|
||||
<td>
|
||||
<div class="thumbcontainer">
|
||||
<a href="http://localhost:8090/ViewImage.png?url=relax.jp2"
|
||||
title="Render JPEG 2000 sample in full size"> <img
|
||||
src="http://localhost:8090/ViewImage.png?maxwidth=128&maxheight=128&quadratic&url=relax.jp2"
|
||||
width="128" height="128" alt="JPEG 2000 render failed" />
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="browserthumb">
|
||||
<a href="http://localhost:8090/env/grafics/test/relax.jp2"
|
||||
title="Render JPEG 2000 sample in full size"> <img
|
||||
src="http://localhost:8090/env/grafics/test/relax.jp2"
|
||||
width="128" height="128" alt="JPEG 2000 render failed" />
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>KTX</td>
|
||||
<td>image/ktx</td>
|
||||
<td>.ktx</td>
|
||||
<td>KTX (format for storing textures for OpenGL and OpenGL ES
|
||||
applications)</td>
|
||||
<td>
|
||||
<div class="thumbcontainer">No Sample</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="browserthumb">No Sample</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>NAPLPDS</td>
|
||||
<td>image/naplps</td>
|
||||
<td>not known</td>
|
||||
<td>North American Presentation Layer Protocol Syntax</td>
|
||||
<td>
|
||||
<div class="thumbcontainer">No Sample</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="browserthumb">No Sample</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>BTIF</td>
|
||||
<td>image/prs.btif</td>
|
||||
<td>.btif, .btf</td>
|
||||
<td>Bank check images and ASCII text data, used by Nations Bank</td>
|
||||
<td>
|
||||
<div class="thumbcontainer">No Sample</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="browserthumb">No Sample</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>PTI</td>
|
||||
<td>image/prs.pti</td>
|
||||
<td>.pti</td>
|
||||
<td>PTI</td>
|
||||
<td>
|
||||
<div class="thumbcontainer">No Sample</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="browserthumb">No Sample</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>PWG Raster</td>
|
||||
<td>image/pwg-raster</td>
|
||||
<td>none</td>
|
||||
<td>Used for printing "raw" image data in formats acceptable to
|
||||
printers</td>
|
||||
<td>
|
||||
<div class="thumbcontainer">No Sample</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="browserthumb">No Sample</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>T38</td>
|
||||
<td>image/t38</td>
|
||||
<td>none</td>
|
||||
<td>Only used for T.38 media stream in SDP</td>
|
||||
<td>
|
||||
<div class="thumbcontainer">No Sample</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="browserthumb">No Sample</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>PSD</td>
|
||||
<td>image/vnd.adobe.photoshop</td>
|
||||
<td>.psd</td>
|
||||
<td>Adobe Photoshop file</td>
|
||||
<td>
|
||||
<div class="thumbcontainer">No Sample</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="browserthumb">No Sample</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>AZV</td>
|
||||
<td>image/vnd.airzip.accelerator.azv</td>
|
||||
<td>.azv</td>
|
||||
<td>AirZip file</td>
|
||||
<td>
|
||||
<div class="thumbcontainer">No Sample</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="browserthumb">No Sample</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
After Width: | Height: | Size: 81 KiB |
After Width: | Height: | Size: 213 KiB |
After Width: | Height: | Size: 1.4 MiB |
After Width: | Height: | Size: 7.9 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 2.7 KiB |
After Width: | Height: | Size: 385 KiB |