Multiple add problem

Phoca Gallery - image gallery extension
dadi
Phoca Newbie
Phoca Newbie
Posts: 1
Joined: 24 Aug 2011, 10:49

Multiple add problem

Post by dadi »

Hi at all,
I have installed phocagallery on my server and it seem works correctly but when I try to upload multiple photos it uploads only the first one and then no error messages or other.
Can you help me please???

Davide
lick
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 25 Aug 2011, 17:50

Re: Multiple add problem

Post by lick »

I am having the same trouble!! any ideas anyone?
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49150
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Multiple add problem

Post by Jan »

Hi, which version you are using, which multiple upload feature?

Which size your images have, maybe if they are large, the server and GD library will end with memory fatal error - which cannot be managed, try to upload smaller images.

Jan
If you find Phoca extensions useful, please support the project
lick
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 25 Aug 2011, 17:50

Re: Multiple add problem

Post by lick »

OK, I have tried with bunches of 5/6 images and experimented with both large (6mb) and small (150kb) files. Even if I use 5 small files it only successfully uploads the first one and then hangs indefinitely??

I have tried the flash/Silverlight/html5 and html4 methods and all have the same issue.

the version of my joomla install is 1.7 and the phoca version is 3.0.2

apart from this, everything else seem fine??
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49150
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Multiple add problem

Post by Jan »

Hmm, really no idea what can be wrong there, testing now, everything is Ok.

There can be two problems:
- first the javascript problem, can be displayed in the javscript console (e.g. in firebug)
- second the server returns an unexpected result (but there are handled the exceptions so only fatal error cannot be handled, image with 150kb should not return e.g. memory fatal error as it is only an uploading of image, no thumbnail creating)

Do you get the same problems in boht sides -in administration (multiple add, or image selecting) and in frontend in UCP?
If you find Phoca extensions useful, please support the project
lick
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 25 Aug 2011, 17:50

Re: Multiple add problem

Post by lick »

No, only the front end. back end works perfectly!
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49150
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Multiple add problem

Post by Jan »

Try to check the javascript console e.g. in Firefox with Firebug, to test if there is some javascript error :idea:

Jan
If you find Phoca extensions useful, please support the project
smoothj1970
Phoca Newbie
Phoca Newbie
Posts: 5
Joined: 31 Aug 2011, 01:59

Re: Multiple add problem

Post by smoothj1970 »

Same thing happened to me after I updated flash to v10.

The java uploader works perfectly with the newest java 1.6.0_27

I dont know that flash effected any of the other upload methods as I never tried them until after I updated flash and noticed the uploader problems but post flash 10 update none of it seems to work but the java one.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49150
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Multiple add problem

Post by Jan »

Hi, java vs. flash vs javascript are independent to each other and should not conflict together :idea:
If you find Phoca extensions useful, please support the project
mccool1985
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 01 Sep 2011, 03:37

Re: Multiple add problem

Post by mccool1985 »

Hi, i had the same problem and did what was suggested, debugging it with Firebug.

It gave me an error in \administrator\components\com_phocagallery\libraries\phocagallery\geo\geo.php (division by zero) on line 63

It seems it tries to get the Location out of EXIF data. So when these coordinates are in there and are set to 0, you have a problem. In the code they did not think about this clearly. Anyway, after the first image is uploaded, it tries to get the location out of it, and exits after it receives multiple division by zero errors, that's why the uploader hangs after the first upload.

Did a little hack in the code, quick workaround

--- WORKAROUND ---

Find this code on line 47 in geo.php:

Code: Select all

if (!function_exists('exif_read_data')) {
		return array('latitude' => 0, 'longitude' => 0);
	} else {
	  
		$exif 		= exif_read_data($fileOriginal, 0, true);
		$GPSLatDeg 	= explode('/',$exif['GPS']['GPSLatitude'][0]);
		$GPSLatMin 	= explode('/',$exif['GPS']['GPSLatitude'][1]);
		$GPSLatSec 	= explode('/',$exif['GPS']['GPSLatitude'][2]);
		$GPSLonDeg 	= explode('/',$exif['GPS']['GPSLongitude'][0]);
		$GPSLonMin 	= explode('/',$exif['GPS']['GPSLongitude'][1]);
		$GPSLonSec 	= explode('/',$exif['GPS']['GPSLongitude'][2]);

		$lat = $GPSLatDeg[0]/$GPSLatDeg[1]+
			($GPSLatMin[0]/$GPSLatMin[1])/60+
			($GPSLatSec[0]/$GPSLatSec[1])/3600;
		$long = $GPSLonDeg[0]/$GPSLonDeg[1]+
			($GPSLonMin[0]/$GPSLonMin[1])/60+
			($GPSLonSec[0]/$GPSLonSec[1])/3600;
		// $exif['GPS']['GPSLatitudeRef'] SHIROTA: N=+; S=-
		// $exif['GPS']['GPSLongitudeRef'] DOLGOTA: E=+; W=-
		if($exif['GPS']['GPSLatitudeRef'] == 'S'){$lat=$lat*(-1);}
		if($exif['GPS']['GPSLongitudeRef'] == 'W'){$long=$long*(-1);}

		return array('latitude' => $lat, 'longitude' => $long);
	  }
Above this code-block, so on line 46, just insert this code:

Code: Select all

return array('latitude' => 0, 'longitude' => 0);
It basically rips out the option to get a location out of the EXIF data. I'm sure there are far better solutions for this, maybe rewrite the code with some type of try clause in it. I'll let the developers do their work, maybe someone has a suggestion to rewrite the formulas for $lat en $long to make them work (prevent it is divided by zero)

Anyway, for me the above did the trick (and I don't use the EXIF and GPS stuff, so I don't care). After I changed the code my HTML5 uploader worked like a charm!
Post Reply