Bad image file upload

carlod@cogeco.ca

Joined: 2009-09-25
Posts: 2
Posted: Fri, 2009-09-25 14:36

I've installed g3 works great except when uploading some jpegs get bad image file upload. Any ideas?

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16503
Posted: Fri, 2009-09-25 16:06

Is there anything in your gallery3/var/logs directory?

Can you post a link to phpinfo:
FAQ: How do I create a phpinfo page?
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
flacor

Joined: 2009-09-27
Posts: 3
Posted: Sun, 2009-09-27 03:52

Exactly the same problem.

2009-09-26 23:33:15 -04:00 --- alert: exception 'Exception' with message '@todo MISSING_IMAGE_FILE' in /var/www/sites/paradisetipitou/gallery3/modules/gallery/helpers/photo.php:44
Stack trace:
#0 /var/www/sites/paradisetipitou/gallery3/modules/gallery/controllers/simple_uploader.php(64): photo_Core::create(Object(Item_Model), false, false, '')
#1 [internal function]: Simple_Uploader_Controller->add_photo('1')
#2 /var/www/sites/paradisetipitou/gallery3/system/core/Kohana.php(291): ReflectionMethod->invokeArgs(Object(Simple_Uploader_Controller), Array)
#3 [internal function]: Kohana::instance()
#4 /var/www/sites/paradisetipitou/gallery3/system/core/Event.php(209): call_user_func(Array)
#5 /var/www/sites/paradisetipitou/gallery3/system/core/Bootstrap.php(55): Event::run('system.execute')
#6 /var/www/sites/paradisetipitou/gallery3/index.php(86): require('/var/www/sites/...')
#7 {main}

2009-09-26 23:51:57 -04:00 --- alert: exception 'Exception' with message '@todo EMPTY_INPUT_FILE' in /var/www/sites/paradisetipitou/gallery3/modules/gallery/helpers/graphics.php:199
Stack trace:
#0 [internal function]: graphics_Core::resize('/var/www/sites/...', '/var/www/sites/...', Array)
#1 /var/www/sites/paradisetipitou/gallery3/modules/gallery/helpers/graphics.php(155): call_user_func_array(Array, Array)
#2 /var/www/sites/paradisetipitou/gallery3/modules/gallery/helpers/photo.php(126): graphics_Core::generate(Object(Item_Model))
#3 /var/www/sites/paradisetipitou/gallery3/modules/gallery/controllers/simple_uploader.php(64): photo_Core::create(Object(Item_Model), '/var/www/sites/...', 'raphpomme_002.j...', 'raphpomme 002')
#4 [internal function]: Simple_Uploader_Controller->add_photo('5')
#5 /var/www/sites/paradisetipitou/gallery3/system/core/Kohana.php(291): ReflectionMethod->invokeArgs(Object(Simple_Uploader_Controller), Array)
#6 [internal function]: Kohana::instance()
#7 /var/www/sites/paradisetipitou/gallery3/system/core/Event.php(209): call_user_func(Array)
#8 /var/www/sites/paradisetipitou/gallery3/system/core/Bootstrap.php(55): Event::run('system.execute')
#9 /var/www/sites/paradisetipitou/gallery3/index.php(86): require('/var/www/sites/...')
#10 {main}

http://www.paradisetipitou.com/info.php

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16503
Posted: Sun, 2009-09-27 15:48

o.k. A couple things I'd try. Try a different image toolkit, Admin > Graphics

Try settings a valid path for upload_tmp_dir
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
flacor

Joined: 2009-09-27
Posts: 3
Posted: Sun, 2009-09-27 21:22

Changed upload_tmp_dir to /tmp... now:

2009-09-27 17:21:02 -04:00 --- error: Caught exception rebuilding image: logo
@todo EMPTY_INPUT_FILE
#0 [internal function]: graphics_Core::resize('/var/www/sites/...', '/var/www/sites/...', Array)
#1 /var/www/sites/paradisetipitou/gallery3/modules/gallery/helpers/graphics.php(155): call_user_func_array(Array, Array)
#2 /var/www/sites/paradisetipitou/gallery3/modules/gallery/helpers/photo.php(126): graphics_Core::generate(Object(Item_Model))
#3 /var/www/sites/paradisetipitou/gallery3/modules/gallery/controllers/simple_uploader.php(64): photo_Core::create(Object(Item_Model), '/var/www/sites/...', 'logo.png', 'logo')
#4 [internal function]: Simple_Uploader_Controller->add_photo('5')
#5 /var/www/sites/paradisetipitou/gallery3/system/core/Kohana.php(291): ReflectionMethod->invokeArgs(Object(Simple_Uploader_Controller), Array)
#6 [internal function]: Kohana::instance()
#7 /var/www/sites/paradisetipitou/gallery3/system/core/Event.php(209): call_user_func(Array)
#8 /var/www/sites/paradisetipitou/gallery3/system/core/Bootstrap.php(55): Event::run('system.execute')
#9 /var/www/sites/paradisetipitou/gallery3/index.php(86): require('/var/www/sites/...')
#10 {main}
2009-09-27 17:21:02 -04:00 --- alert: exception 'Exception' with message '@todo EMPTY_INPUT_FILE' in /var/www/sites/paradisetipitou/gallery3/modules/gallery/helpers/graphics.php:199
Stack trace:
#0 [internal function]: graphics_Core::resize('/var/www/sites/...', '/var/www/sites/...', Array)
#1 /var/www/sites/paradisetipitou/gallery3/modules/gallery/helpers/graphics.php(155): call_user_func_array(Array, Array)
#2 /var/www/sites/paradisetipitou/gallery3/modules/gallery/helpers/photo.php(126): graphics_Core::generate(Object(Item_Model))
#3 /var/www/sites/paradisetipitou/gallery3/modules/gallery/controllers/simple_uploader.php(64): photo_Core::create(Object(Item_Model), '/var/www/sites/...', 'logo.png', 'logo')
#4 [internal function]: Simple_Uploader_Controller->add_photo('5')
#5 /var/www/sites/paradisetipitou/gallery3/system/core/Kohana.php(291): ReflectionMethod->invokeArgs(Object(Simple_Uploader_Controller), Array)
#6 [internal function]: Kohana::instance()
#7 /var/www/sites/paradisetipitou/gallery3/system/core/Event.php(209): call_user_func(Array)
#8 /var/www/sites/paradisetipitou/gallery3/system/core/Bootstrap.php(55): Event::run('system.execute')
#9 /var/www/sites/paradisetipitou/gallery3/index.php(86): require('/var/www/sites/...')
#10 {main}

 
flacor

Joined: 2009-09-27
Posts: 3
Posted: Mon, 2009-09-28 02:08

RESOLVED !

safe_mode was enabled, I disabled it and it works fine.

 
mafiouso

Joined: 2009-12-26
Posts: 4
Posted: Sat, 2009-12-26 05:03

Upload error: Bad image file
### IF YOUR GETTING THIS ERROR. READ HERE ###

it drove me crazy, it turned out to be a server config error.

from my webhost:

There was an issue with "mod_security". We have tweaked it a bit and its working fine now.

We have liberalized the rule set on the mod security file to correct the issue. The rules are set on the file '/usr/local/apache/conf/modsec_rootkits.conf'.

[Wed Oct 28 12:22:08 2009] [error] [client XXX.89.XXX.167] ModSecurity: Access denied with code 406 (phase 2). Pattern match "=(http|www|ftp)\\:/(.+)\\.(c|dat|kek|gif|jpe?g|jpeg|png|sh|txt|bmp|dat|txt|js|html?|tmp|asp)\\x20?\\?" at REQUEST_URI. [file "/usr/local/apache/conf/modsec_rootkits.conf"] [line "27"] [id "390144"] [rev "1"] [msg "Rootkit attack: Generic Attempt to install rootkit"] [severity "CRITICAL"] [hostname "YOUR URL.com"] [uri "/forum/images/avatars/gallery/pictureview-password-2008.html//appserv/main.php"] [unique_id "HIDDEN"]

HOPE THIS HELPED