(Suspecting) broken connection behavior

Image scaler add-on.
User avatar
support
Posts: 1503
Joined: Sun Jan 27, 2008 6:19 pm

Re: (Suspecting) broken connection behavior

Post by support »

I need you to provide a procedure to allow me to reproduce the problem so I could help.
What about the configuration of your php.ini file ? Most PHP server are setup to allow only 2MB file upload maximum.

dstonek
Posts: 52
Joined: Fri Mar 21, 2008 3:19 pm

Re: (Suspecting) broken connection behavior

Post by dstonek »

Maximum file upload size and Maximum HTTP POST size are set to 15MB.
But this is not the point.
The applet must not upload such heavy files.
It has to resize them all to 500 pixels the longest side and then upload to server.
Files will be no more than 100Kb.
I got this problem with two different film scanned files.
There was no problem with a flat scanner (meta info near to nothing) I have in my desk

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

Re: (Suspecting) broken connection behavior

Post by support »

And could you share the files that cause the problem ?

dstonek
Posts: 52
Joined: Fri Mar 21, 2008 3:19 pm

Re: (Suspecting) broken connection behavior

Post by dstonek »

Yes, they are photos from Wikipedia.org
I posted a link in an earlier post.
Despite the applet error message the files are uploaded to their target dir.
Example 1
Example 2
They all were not downsampled by the applet.
Thanks
PS: not all no resized uploads got that error msg I posted in a snapshot.
Last edited by dstonek on Mon Oct 06, 2008 7:09 pm, edited 1 time in total.

dstonek
Posts: 52
Joined: Fri Mar 21, 2008 3:19 pm

Broken connections solution

Post by dstonek »

For the broken connections issue...
My problem wasn't to resume a large file uploads but a large amount of small files.
I made some changes and my first attempt went good.
document.writeln('<PARAM NAME="resume" VALUE="true">');
document.writeln('<PARAM NAME="retry" VALUE="10">');
document.writeln('<PARAM NAME="retrydelay" VALUE="20">');

I am using POST, not PUT method
In process file I've added the part that refers to
if ($_SERVER['REQUEST_METHOD'] == 'HEAD'){ ... }
without modifications (php sample you provide.

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

Re: (Suspecting) broken connection behavior

Post by support »

Image samples have large dimensions. More than 3000x3000.
Example 1 is 6400 x 5378 pixels which leads to OutOfMemory issue (by default Applet can run in 64MB heap size). When I try to scale it I get: Failed Montreal_City_Hall_Jan_2006.jpg Java heap space. See: http://www.jfileupload.com/products/jim ... aq.html#18
The applet detects it has not enough memory to scale image so it uploads the image as is. That's why you get the original file on server.

dstonek
Posts: 52
Joined: Fri Mar 21, 2008 3:19 pm

Re: (Suspecting) broken connection behavior

Post by dstonek »

Ok, thanks I'll follow that suggestions and try again.
Just in case I prevent this events and set to resample those files in server side in process file.

dstonek
Posts: 52
Joined: Fri Mar 21, 2008 3:19 pm

Re: (Suspecting) broken connection behavior

Post by dstonek »

Solutions you suggest:
1 - Increase heap size for applets in client-side Java control panel. Under windows :
Start->Control Panel->Java->Java tab->Java plugin runtime->Display and add
the following in execution parameters : -Xmx128m
2 - Use smaller values for maxwidth and maxheight (for instance 3000x3000).
3 - Use impl=ImageIOSubsample to select a subsample scaling algorithm. This one
allows integer scale factor only so it won't fit exactly to maxwidth and
maxheight.
4 - (not available yet) JRE 1.6 Update 10 will allow to setup heap size as applet
parameter. So, workaround#1 above will be easy to setup.
1.- I avoid to complicate the user with client program settings. This will be the very last solution.
2.- My max values are 500x500 Target files must fit into this square.
3.- Because of that sharpening issue I prefer to impl=awt
4.- I don't know which update is JRE 1.6 at this time in java.com

I took another file and manually resampled to 6000x4500
This is a Firefox-Linux environment.
Java Plug-in 1.6.0_03
Using JRE version 1.6.0_03 Java HotSpot(TM) Client VM
Memory: 65,088K Free: 52,097K (80%) ... completed.
The applet could not resize this file and started uploading as it is.

In the same computer I have a vmware Win XP window.
IE6
Java Plug-in 1.6.0_07
Usar versión JRE 1.6.0_07 Java HotSpot(TM) Client VM
Memory: 55.516K Free: 50.062K (90%) ... terminado.
It did resize the same file!

Now I am testing your suggestion #1
In FF
Memory: 11,584K Free: 5,199K (44%) ... completed.
Now the applet have resized the file!

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

Re: (Suspecting) broken connection behavior

Post by support »

Solution #4 should be available soon. SUN said "Fall 2008". It will allow to setup Java heap as Applet parameter. It means that you will be able to use solution #1 without modifications in the user's Java control panel.

Post Reply