filterprocess

Image scaler add-on.
Post Reply
joan
Posts: 2
Joined: Wed Feb 15, 2012 2:54 pm

filterprocess

Post by joan »

Hello there, i am working on a legacy proyect, that uses jFileUpload + JImageFilter premium in order to load images, with a the original resolution, low resolution and a thumb version. So far so good. The problem is that, in order to configure the filters, it uses a filterProcess that describes the whole filter in one line, as follows:

Code: Select all

...
<PARAM NAME="scriptable" VALUE="true">		          //these properties 
<PARAM NAME="enableFilterProcess" VALUE="true">//are not documented
...
<PARAM NAME="filterProcess3" VALUE="700 ,700 , 0, #0##1# , ld    , false  , false  , false , 1  ,          ,          , false    ,          ,">                  //one line, comma separated.
...
I searched in the documentation and the forum, but i do not found any reference to the filterprocess, even less which parameter is which.

So, I need to set to 550px the smaller dimension of the image of the third filter, and it should looks something like:

Code: Select all

<PARAM NAME="filterProcess3param1" VALUE="landscape.maxheight">'
<PARAM NAME="filterProcess3value1" VALUE="550">
<PARAM NAME="filterProcess3param2" VALUE="landscape.maxwidth">
<PARAM NAME="filterProcess3value2" VALUE="0">

<PARAM NAME="filterProcess3param3" VALUE="portrait.maxheight"> 
<PARAM NAME="filterProcess3value3" VALUE="0">
<PARAM NAME="filterProcess3param4" VALUE="portrait.maxwidth">
<PARAM NAME="filterProcess3value4" VALUE="550">
But no luck, I also try to setting the values via Javascript using setProperty(), but notting. It simply ignores the setup after the one line asignation.

Any idea?

i will send the whole applet_http_jsapi.js in the next post.

User avatar
support
Posts: 1503
Joined: Sun Jan 27, 2008 6:19 pm

Re: filterprocess

Post by support »

Please post the full applet_http_jsapi.js

joan
Posts: 2
Joined: Wed Feb 15, 2012 2:54 pm

Re: filterprocess

Post by joan »

Sorry, here it is.

Code: Select all

<!--
//var clase = "jfileupload.upload.client.MApplet.class";
var clase = "jfileupload.upload.client.JSMApplet.class";
var lib = "lib/jfileupload.jar,lib/httpimpl.jar,lib/chttpclient.jar,lib/clogging.jar,lib/previewui.jar,lib/ifilter.jar,lib/resourcesFondos.jar";
lib = lib + ",lib/jsapi.jar";
//lib = lib + ",lib/landf/squareness.jar";
//lib = lib + ",lib/landf/fhlaf_1.0b2_bin.jar"; //se ve como Metal
//lib = lib + ",lib/landf/ilf-gpl.jar"; //se ve como Metal
//lib = lib + ",lib/landf/looks-2.2.1.jar"; //se ve como Metal
//lib = lib + ",lib/landf/liquidlnf.jar"; //popup "Seleccionar archivo" no funciona
//lib = lib + ",lib/landf/napkinlaf.jar"; //popup "Seleccionar archivo" no funciona
//lib = lib + ",lib/landf/OfficeLnFs_2.7.jar"; //se ve como Metal
//lib = lib + ",lib/landf/PgsLookAndFeel.jar"; //popup "Seleccionar archivo" no funciona
//lib = lib + ",lib/landf/quaqua.jar"; //popup "Seleccionar archivo" no funciona
//lib = lib + ",lib/landf/tinylaf.jar"; //se ve como Metal
function JSAppletInitialized(cadena){
	var resoluciones = document.getElementsByName('radio');
	var i;
	for (i=0;i<document.getElementsByName('radio').length;i++){
		resoluciones[i].disabled = false;
    }
}
function JSTransferTriggered(cadena){}
function JSFilterStarting(cadena){}
function JSFilterCompleted(cadena){}
function JSFilterStarted(cadena){}
function JSTransferStarted(cadena){}
function JSTransferCompleted(cadena){}
function JSTransferCancelled(cadena){}
function JSTransferDone(cadena){}
function JSTransferFailed(cadena){}
function JSNotifyResponse(cadena){
	if(!isNaN(cadena)) {
		var wrapper = document.getElementById('contenedoraRespuestasApplet');
		if (wrapper.value != '') {
			wrapper.value += ',';
		}
		wrapper.value += cadena;
	}
}

var _info = navigator.userAgent;
var _ns = false;
var _ns6 = false;
var _ie = (_info.indexOf("MSIE") > 0 && _info.indexOf("Win") > 0 && _info.indexOf("Windows 3.1") < 0 && _info.indexOf("MSIE 8") < 0);
if (_info.indexOf("Opera") > 0) _ie = false;
var _ns = (navigator.appName.indexOf("Netscape") >= 0 && ((_info.indexOf("Win") > 0 && _info.indexOf("Win16") < 0) || (_info.indexOf("Sun") > 0) || (_info.indexOf("Linux") > 0) || (_info.indexOf("AIX") > 0) || (_info.indexOf("OS/2") > 0) || (_info.indexOf("IRIX") > 0)));
var _ns6 = ((_ns == true) && (_info.indexOf("Mozilla/5") >= 0));
if (_ie == true) {
  document.writeln('<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH="800" HEIGHT="400" NAME="fileupload" codebase="http://java.sun.com/update/1.4.2/jinstall-1_4-windows-i586.cab#Version=1,4,0,0">');
}
else if (_ns == true && _ns6 == false) { 
   // BEGIN: Update parameters below for NETSCAPE 3.x and 4.x support.
  document.write('<EMBED ');
  document.write('type="application/x-java-applet;version=1.4" ');
  document.write('CODE="'+clase+'" ');
  document.write('JAVA_CODEBASE="./" ');
  document.write('ARCHIVE="'+lib+'"');
  document.write('NAME="fileupload" ');
  document.write('WIDTH="800" ');
  document.write('HEIGHT="400" ');
  document.write('url="'+url+'" ');
  document.write('mode="http" ');
  document.write('scriptable=true '); 
  document.write('paramfile="imagen" ');
  document.write('java_arguments="-Xmx384M" ');
  document.write('enableFilterProcess=true ');
  document.write('maxFileSizeAllowed=20761804 ');
  //Filtro para fondos
  document.write('filterProcess1="0      , 0     , 0			,                            ,       , false  , false  , true  , 1  ,          ,          , false    ,          ," ');
  document.write('filterProcess2="2800   , 2800  , 16769025 	, #0##1#                     , hd    , false  , false  , false , 1  ,          ,          , false    ,          ," ');
  document.write('filterProcess3="700    , 700   , 0			, #0##1#                     , ld    , false  , false  , false , 1  ,          ,          , false    ,          ," ');
  document.write('filterProcess4="770    , 570   , 0			, #0#_mini#1#                , mini  , false  , false  , false , 1  ,          ,          , true     , _mini\.(?:png|jpg|jpeg|gif)" ');
  document.write('whitelist="*.jpg,*.jpeg,*.png" ');
   //*************Parámetros de .properties*********************************
   if (idioma == 'en_US')
   {
     document.write('resources="i18n_bar_en" ');
	 document.write('transferuiresources="i18n_pane_en" ');
   }else{
	   if (idioma == 'pt_PT')
	   {
		   document.write('resources="ii18n_bar_pt" ');
		   document.write('transferuiresources="i18n_pane_pt" ');
	   }else{
			document.write('resources="i18n_bar" ');
			document.write('transferuiresources="i18n_pane" ');
	   }
   }
  //*************Parámetros de JFilterUpload y JImageUpload****************
  document.write('transferui="jfileupload.transfer.client.preview.PreviewerTransferUI" ');
  document.write('hidebar=false ');
  document.write('preferences=true ');  
  document.write('filter=jfileupload.upload.client.filter.ImageFilter ');
  document.write('filterproperties=scaling.properties ');
  //*************Parámetros de JSAPI***************************************
  document.write('mayscript=true ');
  //**************Parámetros para receptor*********************************
  document.write('param1="Id_CategoriaFondo"');
  document.write('value1="'+Id_CategoriaFondo+'"');
    //**************Parámetros para manejo de errores************************
  document.write('param4="errorheader"');
  document.write('value4="errorhd"');
  //**************Parámetros para limitar la cantidad de archivos a subir**
  document.write('maxfiles="'+maxASubir+'"');
  //***********************************************************************
  document.write('param5="dynamicauth"');
  document.write('value5="true"');
  //**************Parámetro para resetar barra de progreso al cancelar*****
  document.write('resetprogressbar="true"');

  /*document.write('authentication="auto"');
  document.writeln('param5="httpproxyhost"');
  document.writeln('value5="localhost"');
  document.writeln('param6="httpproxyport"');
  document.writeln('value6="8080"');*/

  document.writeln('pluginspage="http://java.sun.com/products/plugin/index.html#download"><NOEMBED>');
  // END
}
else {
    document.writeln('<APPLET CODE="'+clase+'" JAVA_CODEBASE="./" ARCHIVE="'+lib+'" WIDTH="800" HEIGHT="400" NAME="fileupload">');

}
// BEGIN: Update parameters below for INTERNET EXPLORER, FIREFOX, SAFARI, OPERA, MOZILLA, NETSCAPE 6+ support.
document.writeln('<PARAM NAME="java_arguments" VALUE="-Xmx384M">' );
document.writeln('<PARAM NAME=CODE VALUE="'+clase+'" >');
document.writeln('<PARAM NAME=CODEBASE VALUE="./">');
document.writeln('<PARAM NAME=ARCHIVE VALUE="'+lib+'">');
document.writeln('<PARAM NAME=NAME VALUE="fileupload">');
document.writeln('<PARAM NAME="type" VALUE="application/x-java-applet;version=1.4">');
document.writeln('<PARAM NAME="url" VALUE="'+url+'" ');
document.writeln('<PARAM NAME="mode" VALUE="http">');
document.writeln('<PARAM NAME="scriptable" VALUE="true">');
document.writeln('<PARAM NAME="paramfile" VALUE="imagen">');
document.writeln('<PARAM NAME="enableFilterProcess" VALUE="true">');
document.writeln('<PARAM NAME="maxFileSizeAllowed" VALUE="20761804">');
//Filtro para fondos
document.writeln('<PARAM NAME="filterProcess1" VALUE="0      , 0     , 0			,                            ,       , false  , false  , true  , 1  ,          ,          , false    ,          ,">');
document.writeln('<PARAM NAME="filterProcess2" VALUE="2800   , 2800  , 16769025 	, #0##1#                     , hd    , false  , false  , false , 1  ,          ,          , false    ,          ,">');
document.writeln('<PARAM NAME="filterProcess3" VALUE="700    , 700   , 0			, #0##1#                     , ld    , false  , false  , false , 1  ,          ,          , false    ,          ,">');
document.writeln('<PARAM NAME="filterProcess4" VALUE="770    , 570   , 0			, #0#_mini#1#                , mini  , false  , false  , false , 1  ,          ,          , true     , _mini\.(?:png|jpg|jpeg|gif)">');
document.writeln('<PARAM NAME="whitelist" VALUE="*.jpg,*.jpeg,*.png">');
//*************Parámetros de .properties*********************************
   if (idioma == 'en_US')
   {
	 document.writeln('<PARAM NAME="resources" VALUE="i18n_bar_en">');
	 document.writeln('<PARAM NAME="transferuiresources" VALUE="i18n_pane_en">');
   }else{
	   if (idioma == 'pt_PT')
	   {
		   document.writeln('<PARAM NAME="resources" VALUE="i18n_bar_pt">');
		   document.writeln('<PARAM NAME="transferuiresources" VALUE="i18n_pane_pt">');
	   }else{
			document.writeln('<PARAM NAME="resources" VALUE="i18n_bar">');
			document.writeln('<PARAM NAME="transferuiresources" VALUE="i18n_pane">');
	   }
   }

//*************Parámetros de JFilterUpload y JImageUpload****************
document.writeln('<PARAM NAME="transferui" VALUE="jfileupload.transfer.client.preview.PreviewerTransferUI">');
document.writeln('<PARAM NAME="preferences" VALUE="true">');
document.writeln('<PARAM NAME="hidebar" VALUE="false">');
document.writeln('<PARAM NAME="filterproperties" VALUE="scaling.properties">');
document.writeln('<PARAM NAME="filter" VALUE="jfileupload.upload.client.filter.ImageFilter">');
//*************Parámetros de JSAPI***************************************
document.writeln('<PARAM NAME="mayscript" VALUE="true">');
//**************Parámetros para receptor*********************************
document.writeln('<PARAM NAME="param1" VALUE="Id_CategoriaFondo">');
document.writeln('<PARAM NAME="value1" VALUE="'+Id_CategoriaFondo+'">');
//**************Parámetros para manejo de errores************************
document.writeln('<PARAM NAME="param4" VALUE="errorheader">');
document.writeln('<PARAM NAME="value4" VALUE="errorhd">');
//**************Parámetros para limitar la cantidad de archivos a subir**
document.writeln('<PARAM NAME="maxfiles" VALUE="'+maxASubir+'">');
//***********************************************************************
document.writeln('<PARAM NAME="param5" VALUE="dynamicauth">');
document.writeln('<PARAM NAME="value5" VALUE="true">');
//**************Parámetro para resetar barra de progreso al cancelar*****
document.writeln('<PARAM NAME="resetprogressbar" VALUE="true">');

/*document.write('<PARAM NAME="authentication" VALUE="auto">');
document.writeln('<PARAM NAME="param5" VALUE="httpproxyhost">');
document.writeln('<PARAM NAME="value5" VALUE="localhost">');
document.writeln('<PARAM NAME="param6" VALUE="httpproxyport">');
document.writeln('<PARAM NAME="value6" VALUE="8080">');*/


// END
if (_ie == true) {
  document.writeln('</OBJECT>');
}
else if (_ns == true && _ns6 == false) {
  document.writeln('</NOEMBED></EMBED>');
}
else {
  document.writeln('</APPLET>');
}
//-->



User avatar
support
Posts: 1503
Joined: Sun Jan 27, 2008 6:19 pm

Re: filterprocess

Post by support »

I sent you an email because it seems to be a custom code not added by us.

Post Reply