Rename images additionalfilterid jimagefilter

Image scaler add-on.

Rename images additionalfilterid jimagefilter

Postby Gonzalo » Tue Jul 14, 2009 11:42 pm

I have tried to use the code that you
Second, you need to declare the two filters in applet javascript file:
Code: Select all
...
  <PARAM NAME="resources" VALUE="i18n">
  <PARAM NAME="additionalfilterid" VALUE="medium,small">
  <PARAM NAME="mediumfilter" VALUE="jfileupload.upload.client.filter.ImageFilter">
  <PARAM NAME="mediumfilterproperties" VALUE="scaling_medium.properties">
  <PARAM NAME="smallfilter" VALUE="jfileupload.upload.client.filter.ImageFilter">
  <PARAM NAME="smallfilterproperties" VALUE="scaling_small.properties">

Finally, you need to setup a custom rename policy to avoid file overwrite:
  <PARAM NAME="mediumfilterparam2" VALUE="renamepolicy">
  <PARAM NAME="mediumfiltervalue2" VALUE="custom">
  <PARAM NAME="mediumfilterparam3" VALUE="id">
  <PARAM NAME="mediumfiltervalue3" VALUE="thumb_640_480_">
  <PARAM NAME="smallfilterparam2" VALUE="renamepolicy">
  <PARAM NAME="smallfiltervalue2" VALUE="custom">
  <PARAM NAME="smallfilterparam3" VALUE="id">
  <PARAM NAME="smallfiltervalue3" VALUE="thumb_160_120_">


but I found a problem, do not like putting the name of each image I want.
Gonzalo
 
Posts: 15
Joined: Mon Jun 08, 2009 9:47 am

Re: Rename images additionalfilterid jimagefilter

Postby support » Wed Jul 15, 2009 7:09 pm

Please find (attached below) a working sample of JFileUpload + JImageFilter 2.4. It includes ready to use sample for both HTTP and FTP upload. They generate and upload two images according to the tutorial. Open applet_ftp_scaling.html or applet_http_scaling.html to test it. You also need to update the JavaScript according to your server settings.

JFileUpload_JImageFilter_2.4_two_thumbnails.zip
JFileUpload + JImageFilter 2.4
(705.66 KiB) Downloaded 753 times
User avatar
support
 
Posts: 1501
Joined: Sun Jan 27, 2008 6:19 pm

Re: Rename images additionalfilterid jimagefilter

Postby Gonzalo » Thu Jul 16, 2009 12:48 pm

You can rename the images uploaded to a name that does not contain the original name?
Gonzalo
 
Posts: 15
Joined: Mon Jun 08, 2009 9:47 am

Re: Rename images additionalfilterid jimagefilter

Postby support » Thu Jul 16, 2009 7:34 pm

Could you provide a sample of scaled image name you want if you upload image1.jpg and image2.jpg?
User avatar
support
 
Posts: 1501
Joined: Sun Jan 27, 2008 6:19 pm

Re: Rename images additionalfilterid jimagefilter

Postby Gonzalo » Fri Jul 17, 2009 12:11 pm

that's exactly what I need.
thanks
Gonzalo
 
Posts: 15
Joined: Mon Jun 08, 2009 9:47 am

Re: Rename images additionalfilterid jimagefilter

Postby support » Fri Jul 17, 2009 4:54 pm

Add the following parameter in the JavaScript:
<PARAM NAME="template" VALUE="image:timestamp::extension:">

and image uploaded will look like:
image1247849384642.jpeg
image1247849384815.jpeg
image1247849387175.jpeg
image1247849389356.jpeg
...

template parameter allows renaming filename on upload. Documentation is available at:
http://www.jfileupload.com/products/jfi ... n_ftp.html

Could it fit to your need?
User avatar
support
 
Posts: 1501
Joined: Sun Jan 27, 2008 6:19 pm

Re: Rename images additionalfilterid jimagefilter

Postby Gonzalo » Fri Jul 17, 2009 5:12 pm

what I need is that the parameters of medium;
PARAM NAME = "mediumfilterparam3" VALUE = "id" to give it a name '< "ID">. Jpg'
parameters and small;
PARAM NAME = "smallfilterparam3" VALUE = "id" power to name 'small_< "ID">. Jpg'
< "ID"> is a name taken from the index table
can be done with jimagefilter?
excuse my spelling, but I would not write in English and use the translator google
Gonzalo
 
Posts: 15
Joined: Mon Jun 08, 2009 9:47 am

Re: Rename images additionalfilterid jimagefilter

Postby support » Sun Jul 26, 2009 3:58 pm

We've just added auto increment identifier support in renaming template for release 2.5.
"identifierinit" parameter allows selecting starting identifier:
<PARAM NAME="template" VALUE="myfile_:identifier::extension:">
<PARAM NAME="identifierinit" VALUE="1">

Then uploaded files will be renamed as:
myfile_1.jpg
myfile_2.jpg
myfile_3.jpg
...

I will drop you an email with the 2.5 Beta.
User avatar
support
 
Posts: 1501
Joined: Sun Jan 27, 2008 6:19 pm

Re: Rename images additionalfilterid jimagefilter

Postby Gonzalo » Fri Jul 31, 2009 11:42 pm

I'm trying to update and save file with me a number followed by the extension "1249083271967" and add the original file name;
name of the file to upload "image1"
I need to put the name "ID1"
name records after uploading the file:
"image1.jpg.132345678794"

I use the code:
Code: Select all
document.writeln('<PARAM NAME="template" VALUE="id1:identifier::extension:">')
document.writeln('<PARAM NAME="identifierinit" VALUE="1">')   
document.writeln('<PARAM NAME="additionalfilterid" VALUE="medium,small">');
document.writeln('<PARAM NAME="mediumfilter" VALUE="jfileupload.upload.client.filter.ImageFilter">');
document.writeln('<PARAM NAME="mediumfilterproperties" VALUE="scaling_medium.properties">');
document.writeln('<PARAM NAME="smallfilter" VALUE="jfileupload.upload.client.filter.ImageFilter">');
document.writeln('<PARAM NAME="smallfilterproperties" VALUE="scaling_small.properties"> ');
document.writeln('<PARAM NAME="mediumfilterparam2" VALUE="renamepolicy">');
document.writeln('<PARAM NAME="mediumfiltervalue2" VALUE="custom">');
document.writeln('<PARAM NAME="mediumfilterparam3" VALUE="id">');
document.writeln('<PARAM NAME="mediumfiltervalue3" VALUE="medium_">');
document.writeln('<PARAM NAME="smallfilterparam2" VALUE="renamepolicy">');
document.writeln('<PARAM NAME="smallfiltervalue2" VALUE="custom">');
document.writeln('<PARAM NAME="smallfilterparam3" VALUE="id">');
document.writeln('<PARAM NAME="smallfiltervalue3" VALUE="small_">');
Gonzalo
 
Posts: 15
Joined: Mon Jun 08, 2009 9:47 am

Re: Rename images additionalfilterid jimagefilter

Postby support » Sun Aug 02, 2009 7:57 pm

I've just made another test and it works fine.
Images uploaded are:
id11.jpeg
id12.jpeg
id13.jpeg
id14.jpeg
...

Could you try to clean your Java cache before testing:
Start->Control panel->Java->First tab->Delete temporary files->Apply

I enclose my JavaScript.
applet_http_scaling.zip
JavaScript with new template
(1.43 KiB) Downloaded 752 times
User avatar
support
 
Posts: 1501
Joined: Sun Jan 27, 2008 6:19 pm

Next

Return to JImageFilter



cron

Sitemap | Privacy Statement | Java and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc.
in the U.S. and other countries. All other company and/or product names are the property of their respective owners.