[Solved] Image Upload Problem

ryanh

Joined: 2005-01-27
Posts: 29
Posted: Tue, 2005-02-01 18:41

I've been receiving errors when uploading photos using the "from web browser" option. What is happening is the photo is uploading fine, but it seems that there is an error when the image is being constrained (500k/640x640), since the image is submitted to the gallery, but is not resized. The 640x640 view shows by default, but the extra large 2000xwhatever image is still there to be viewed (and killing a lot of extra disk space!)

I've searched for someone else having this problem, but didn't come up with much. Below is the error message I'm receiving.

 Error (ERROR_OBSOLETE_DATA) :

    * in modules/core/classes/GalleryStorage/DatabaseStorage.class at line 558 (gallerystatus::error)
    * in modules/core/classes/GalleryStorage.class at line 133 (mysqldatabasestorage::saveentity)
    * in modules/core/classes/GalleryEntity.class at line 268 (gallerystorage::saveentity)
    * in modules/core/classes/GalleryItem.class at line 417 (galleryfilesystementity::save)
    * in modules/sizelimit/classes/SizeLimitHelper.class at line 86 (galleryphotoitem::save)
    * in modules/sizelimit/SetSizeOption.inc at line 88 (sizelimithelper::applylimits)
    * in modules/core/ItemAdd.inc at line 113 (setsizeoption::handlerequestafteradd)
    * in main.php at line 147 (itemaddcontroller::handlerequest)
    * in main.php at line 46
    * in main.php at line 39

I get the same effect if I use the upload applet, however it doesn't show me this error message. The only way I can get it working properly is if I use the remote tool and have it resize before uploading (which means remote works great!)

Any comments would be greatly appreciated.

----

Gallery URL (optional):
Gallery version: feb.1/05 build
Webserver (with version): apache 1.33?
Datatabase (with version):
PHP version (eg 4.2.1):
phpinfo URL (optional):
Graphics Toolkit(s): all available
Operating system: linux
Web browser/version: firefox 1
[/code]

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Tue, 2005-02-01 19:04

does this happen on the upload, but then you go reload the album and find the image is there, just not resized? if not, when does the error occur?

 
ryanh

Joined: 2005-01-27
Posts: 29
Posted: Tue, 2005-02-01 19:24

Yes, after I add the files and descriptions to the form, and click upload, the next page I see (after it's finished uploading) is the error message above.

I don't see any errors when browsing the gallery, the images are also uploaded, however, in full size (not having been resized.)

 
virshu
virshu's picture

Joined: 2003-09-13
Posts: 314
Posted: Tue, 2005-02-01 20:11

ryanh, can you do me a favor - set one of the options (either dimensions, or size) and see if you still get a problem. That would help me narrow down the issue. Actually, if you don't mind - could you try all three combinations: size, dimensions, and both.

Also, you mention that all toolkits are available. Could you disable NetPBM and GD, leaving only ImageMagick. It may not matter for dimensions, but may be crucial for size. Alternatively, if you are running with logging enabled - it will tell you (althoug not quite clearly) what toolkit get employed

It's fairly new module, so you probably won't find anybody else complaining :wink: You are the first!

Thanks

 
ryanh

Joined: 2005-01-27
Posts: 29
Posted: Tue, 2005-02-01 21:27

Error received with only image magik activated w/ max dim. 800x800 / filesize 500kb

Error (ERROR_OBSOLETE_DATA) : UPDATE g2family_Entity SET g_modificationTimestamp=?,g_serialNumber=? WHERE g_id=? AND g_serialNumber=? (1107293117|2|993|1)

    * in modules/core/classes/GalleryStorage/DatabaseStorage.class at line 558 (gallerystatus::error)
    * in modules/core/classes/GalleryStorage.class at line 133 (mysqldatabasestorage::saveentity)
    * in modules/core/classes/GalleryEntity.class at line 268 (gallerystorage::saveentity)
    * in modules/core/classes/GalleryItem.class at line 417 (galleryfilesystementity::save)
    * in modules/sizelimit/classes/SizeLimitHelper.class at line 86 (galleryphotoitem::save)
    * in modules/sizelimit/SetSizeOption.inc at line 88 (sizelimithelper::applylimits)
    * in modules/core/ItemAdd.inc at line 113 (setsizeoption::handlerequestafteradd)
    * in main.php at line 147 (itemaddcontroller::handlerequest)
    * in main.php at line 46
    * in main.php at line 39
 
ryanh

Joined: 2005-01-27
Posts: 29
Posted: Tue, 2005-02-01 21:30

Uploaded file with only image magic activated, and a size limit of 500kb (no image dimension restrictions.)

No errors, and the file size was properly modified.

 
ryanh

Joined: 2005-01-27
Posts: 29
Posted: Tue, 2005-02-01 21:32

Uploaded file with only image magic activated, and a image dimension restriction of 800 x 800, and no file size limitations.

No errors, and the image was properly resized.

Thanks for your help!

 
virshu
virshu's picture

Joined: 2003-09-13
Posts: 314
Posted: Wed, 2005-02-02 04:59

ryanh, could you please get tomorrow's (feb 2) nightly or CVS refresh in couple hours and run the following URL: http://yourserver/gallery2/lib/tools/phpunit/index.php?filter=testChangeBothNoOriginal (obviously, make sure you have the right server name)

Please let me know what you see....

Also, what database are you using?

Thank you for your help! For some reason, I can't reproduce the problem, so I need to try to figure out how is your system different from mine.

 
ryanh

Joined: 2005-01-27
Posts: 29
Posted: Wed, 2005-02-02 12:17

I updated to the Feb 2nd build, and ran your URL:

 Modules
24 active, 35 total +
Module Id 	Active 	Installed
albumselect 	active 	installed
archiveupload 	active 	installed
comment 	active 	installed
customfield 	active 	installed
exif 	active 	installed
gd 	not active 	installed
imageblock 	active 	installed
imageframe 	active 	installed
imagemagick 	active 	installed
migrate 	active 	installed
netpbm 	not active 	installed
newitems 	active 	installed
panorama 	active 	installed
photoaccess 	not active 	installed
randomhighlight 	active 	installed
rearrange 	active 	installed
remote 	active 	installed
search 	active 	installed
sizelimit 	active 	installed
slideshow 	active 	installed
squarethumb 	active 	installed
thumbnail 	active 	installed
thumbpage 	active 	installed
uploadapplet 	active 	installed
watermark 	active 	installed
webcam 	active 	installed
cart 	not active 	installed
core 	active 	installed
debug 	not active 	installed
ffmpeg 	not active 	installed
members 	not active 	installed
nokiaupload 	not active 	installed
register 	not active 	installed
useralbum 	not active 	installed
zipcart 	not active 	installed
Test Results
#	Module	Class	Function	Success?	Time
1	sizelimit 	setsizeoptiontest 	testchangebothnooriginal 	FAIL	2.4733
Summary

2.4733 seconds elapsed

1 test run

3 failures.
Failure Details

   1. testchangebothnooriginal
          * Error (ERROR_OBSOLETE_DATA) : UPDATE g2family_Entity SET g_modificationTimestamp=?,g_serialNumber=? WHERE g_id=? AND g_serialNumber=? (1107346440|2|1004|1)
                o in modules/core/classes/GalleryStorage/DatabaseStorage.class at line 558 (gallerystatus::error)
                o in modules/core/classes/GalleryStorage.class at line 133 (mysqldatabasestorage::saveentity)
                o in modules/core/classes/GalleryEntity.class at line 268 (gallerystorage::saveentity)
                o in modules/core/classes/GalleryItem.class at line 417 (galleryfilesystementity::save)
                o in modules/sizelimit/classes/SizeLimitHelper.class at line 86 (galleryphotoitem::save)
                o in modules/sizelimit/SetSizeOption.inc at line 88 (sizelimithelper::applylimits)
                o in lib/tools/phpunit/ItemAddOptionTestCase.class at line 72 (setsizeoption::handlerequestafteradd)
                o in modules/sizelimit/test/phpunit/SetSizeOptionTest.class at line 315 (setsizeoptiontest::_handlerequestafteradd)
                o in lib/tools/phpunit/phpunit.inc at line 281 (setsizeoptiontest::testchangebothnooriginal)
                o in lib/tools/phpunit/phpunit.inc at line 369 (setsizeoptiontest::runtest)
                o in lib/tools/phpunit/phpunit.inc at line 538 (setsizeoptiontest::runbare)
                o in lib/tools/phpunit/phpunit.inc at line 247 (prettytestresult::run)
                o in lib/tools/phpunit/phpunit.inc at line 454 (setsizeoptiontest::run)
                o in lib/tools/phpunit/phpunit.inc at line 454 (testsuite::run)
                o in lib/tools/phpunit/index.tpl at line 180 (testsuite::run)
                o in lib/tools/phpunit/index.php at line 171
   2. testchangebothnooriginal
          *  
            Mismatch At: [] Array type (array) !== type (NULL)

array (
)

               type:array
            null   type:NULL
   3. testchangebothnooriginal
          *  
            Mismatch At: [] Array type (array) !== type (NULL)

array (
)

               type:array
            null   type:NULL

Looks like the sizelimit module failed... If you'd like access to my gallery to poke around some more, I can give you the login information, just PM me.

Also, here are my exact versions:
PHP version 4.3.10
MySQL version 4.0.22-standard
Apache version 1.3.33 (Unix)

 
virshu
virshu's picture

Joined: 2003-09-13
Posts: 314
Posted: Thu, 2005-02-03 04:38

ryanh allowed me to tinker with his system, and I think I fixed it. The difference between his system and mine (at least the one where I ran the unit tests) was that mine was PHP5. I fixed it; so, if anybody else has the same problem (that happens if you have both dimension and size limits applied and don't keep original) - download from CVS or tomorrow's nightly.

ryanh, I think I removed all the debugging stuff that I put in temporarily (I left the fix, of course). I am not sure how you update your code; but if you see something that looks like leftover from me - you can overwrite with whatver comes from CVS.

Cheers!

 
ryanh

Joined: 2005-01-27
Posts: 29
Posted: Thu, 2005-02-03 12:09

Thank you very much!

This is by far the best community of developers I've ever encountered for support! You guys really care about your product!

Talk to you later!