1.4.10: image you have uploaded is corrupted - if >1024 size 1.4.10: image you have uploaded is corrupted - if >1024 size
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

1.4.10: image you have uploaded is corrupted - if >1024 size

Started by AndrewRH, October 31, 2006, 04:10:09 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

AndrewRH

Hi,

The good news is that I can upload a file that is resized to a max dimension of 1024 (e.g. 1024x768).  However, if I try to upload the original picture (2560x1920) then I get a critical error, as described below.

I just installed 1.4.9 earlier this week.  I then upgraded last night to 1.4.10

Any help would be appreciated.

~Andrew~


I set the config to:
QuoteMax width or height of an intermediate picture/video **        1024
Max size for uploaded files (KB)                                           10240 (yes, 10240)
Max width or height for uploaded pictures/videos (pixels)      1024
Auto resize images that are larger than max width or height  Yes:Everyone 


QuoteCritical error
The file 'albums/userpics/10001/P1170047.JPG' can't be inserted in the album

The image you have uploaded is corrupted or can't be handled by the GD library

QuoteNotices
/db_input.php
Notice line 293: Undefined index: user2
Notice line 294: Undefined index: user3
Notice line 295: Undefined index: user4
Notice line 398: Undefined index: width
Notice line 398: Undefined index: height
/include/functions.inc.php
Warning line 2922: cannot yet handle MBCS in html_entity_decode()!
:
: a gazillion of these :
:
Warning line 2922: cannot yet handle MBCS in html_entity_decode()!
/include/picmgmt.inc.php
Warning line 262: imagecreatefromjpeg() [function.imagecreatefromjpeg]: 'albums/userpics/10001/P1170047.JPG' is not a valid JPEG file
Warning line 262: imagecreatefromjpeg() [function.imagecreatefromjpeg]: 'albums/userpics/10001/P1170047.JPG' is not a valid JPEG file
Warning line 262: imagecreatefromjpeg() [function.imagecreatefromjpeg]: 'albums/userpics/10001/P1170047.JPG' is not a valid JPEG file

QuoteHere's the debug info:
USER:
------------------
Array
(
    [ID] => 343b807235732bf4c414766581fa76ba
    [am] => 1
    [lang] => english
    [liv] => Array
        (
        )

)

==========================
USER DATA:
------------------
Array
(
    [user_id] => 1
    [user_name] => AndrewRH
    [groups] => Array
        (
           
  • => 1
            )

        [disk_max] => 0
        [disk_min] => 0
        [can_rate_pictures] => 1
        [can_send_ecards] => 1
        [ufc_max] => 0
        [ufc_min] => 0
        [custom_user_upload] => 0
        [num_file_upload] => 1
        [num_URI_upload] => 0
        [can_post_comments] => 1
        [can_upload_pictures] => 1
        [can_create_albums] => 1
        [has_admin_access] => 1
        [pub_upl_need_approval] => 0
        [priv_upl_need_approval] => 0
        [group_name] => Administrators
        [upload_form_config] => 0
        [group_quota] => 0
        [can_see_all_albums] => 1
        [group_id] => 1
    )

    ==========================
    Queries:
    ------------------
    Array
    (
       
  • => SELECT extension, mime, content, player FROM cpg149_filetypes; (0.001s)
        [1] => select * from cpg149_plugins order by priority asc; (0s)
        [2] => delete from `db183548106`.cpg149_sessions where time<1162300927 and remember=0; (0.001s)
        [3] => delete from `db183548106`.cpg149_sessions where time<1161094927; (0s)
        [4] => select user_id from `db183548106`.cpg149_sessions where session_id=md5("1596cbf5ec388d24ff8ef18d4497edc90d429b96736c5a9ea07ba4e6954dec28"); (0s)
        [5] => select user_id as id, user_password as password from `db183548106`.cpg149_users where user_id=1 (0s)
        [6] => SELECT u.user_id AS id, u.user_name AS username, u.user_password AS password, u.user_group+100 AS group_id FROM `db183548106`.cpg149_users AS u INNER JOIN `db183548106`.cpg149_usergroups AS g ON u.user_group=g.group_id WHERE u.user_id='1' (0s)
        [7] => SELECT user_group_list FROM `db183548106`.cpg149_users AS u WHERE user_id='1' and user_group_list <> ''; (0s)
        [8] => SELECT MAX(group_quota) as disk_max, MIN(group_quota) as disk_min, MAX(can_rate_pictures) as can_rate_pictures, MAX(can_send_ecards) as can_send_ecards, MAX(upload_form_config) as ufc_max, MIN(upload_form_config) as ufc_min, MAX(custom_user_upload) as custom_user_upload, MAX(num_file_upload) as num_file_upload, MAX(num_URI_upload) as num_URI_upload, MAX(can_post_comments) as can_post_comments, MAX(can_upload_pictures) as can_upload_pictures, MAX(can_create_albums) as can_create_albums, MAX(has_admin_access) as has_admin_access, MIN(pub_upl_need_approval) as pub_upl_need_approval, MIN( priv_upl_need_approval) as  priv_upl_need_approval FROM cpg149_usergroups WHERE group_id in (1) (0s)
        [9] => SELECT group_name FROM  cpg149_usergroups WHERE group_id= 1 (0s)
        [10] => update `db183548106`.cpg149_sessions set time='1162304527' where session_id=md5('1596cbf5ec388d24ff8ef18d4497edc90d429b96736c5a9ea07ba4e6954dec28'); (0s)
        [11] => SELECT user_favpics FROM cpg149_favpics WHERE user_id = 1 (0s)
        [12] => DELETE FROM cpg149_banned WHERE expiry < '2006-10-31 14:22:07' (0s)
        [13] => SELECT * FROM cpg149_banned WHERE (ip_addr='80.246.32.32' OR ip_addr='192.168.114.103' OR user_id=1) AND brute_force=0 (0s)
        [14] => SELECT category FROM cpg149_albums WHERE aid='9' (0s)
        [15] => SELECT COUNT(*) FROM cpg149_pictures WHERE approved = 'NO' (0s)
    )

    ==========================
    GET :
    ------------------
    Array
    (
    )

    ==========================
    POST :
    ------------------
    Array
    (
        [album] => 9
        [MAX_FILE_SIZE] => 10485760
        [title] =>
        [caption] =>
        [keywords] =>
        [event] => picture
        [user1] =>
    )

    ==========================
    VERSION INFO :
    ------------------
    PHP version: 4.4.4 - OK
    ------------------
    mySQL version: 4.0.27-standard-log
    ------------------
    Coppermine version: 1.4.10(stable)
    ==========================
    Module: GD
    ------------------
    GD Version: 2.0 or higher
    FreeType Support: 1
    FreeType Linkage: with freetype
    T1Lib Support:
    GIF Read Support: 1
    GIF Create Support: 1
    JPG Support: 1
    PNG Support: 1
    WBMP Support: 1
    XBM Support:
    JIS-mapped Japanese Font Support:

    ==========================
    Module: mysql
    ------------------
    MySQL Supportenabled
    Active Persistent Links 0
    Active Links 1
    Client API version 4.0.25
    MYSQL_MODULE_TYPE external
    MYSQL_SOCKET /var/run/mysqld/mysqld.sock
    MYSQL_INCLUDE -I/usr/include/mysql
    MYSQL_LIBS -L/usr/lib -lmysqlclient 
    ==========================
    Module: zlib
    ------------------
    ZLib Support enabled
    Compiled Version 1.2.1
    Linked Version 1.2.1
    ==========================
    Server restrictions (safe mode)?
    ------------------
    Directive | Local Value | Master Value
    safe_mode | Off | Off
    safe_mode_exec_dir | /usr/local/php/bin | /usr/local/php/bin
    safe_mode_gid | Off | Off
    safe_mode_include_dir | no value | no value
    safe_mode_exec_dir | /usr/local/php/bin | /usr/local/php/bin
    sql.safe_mode | Off | Off
    disable_functions | no value | no value
    file_uploads | On | On
    include_path | .:/usr/local/lib/php | .:/usr/local/lib/php
    open_basedir | no value | no value
    ==========================
    email
    ------------------
    Directive | Local Value | Master Value
    sendmail_from | no value | no value
    sendmail_path | /usr/sbin/sendmail -t -i  | /usr/sbin/sendmail -t -i
    SMTP | localhost | localhost
    smtp_port | 25 | 25
    ==========================
    Size and Time
    ------------------
    Directive | Local Value | Master Value
    max_execution_time | 50000 | 50000
    max_input_time | -1 | -1
    upload_max_filesize | 20M | 20M
    post_max_size | 8M | 8M
    ==========================
    Page generated in 0.209 seconds - 16 queries in 0.002 seconds - Album set : ; Meta set: ;
~Andrew~

Nibbler


AndrewRH

Hi,

If I could upload it then I would :-)

It happens with any .jpg file that I try to upload.

Here's where the 1024x768 version is: http://cpg.reeves-hall.net/
- look in the "uncategorized items"
- its P1170047_(Large).JPG

Thanks again for any assistance!

~Andrew~
~Andrew~

AndrewRH

I have put an original jpg file here: http://www.reeves-hall.net/P1310655.jpg

It doesn't matter what jpg I choose; I get the same error message from Coppermine, which is:
QuoteThe file 'albums/userpics/10001/P1310655.JPG' can't be inserted in the album

The image you have uploaded is corrupted or can't be handled by the GD library

File: /homepages/36/d183424680/htdocs/cpg/db_input.php - Line: 402

Here's part of the PHP configuration at my host (1and1.com) is okay...
QuoteDirective LocalValue MasterValue
allow_url_fopen On On
auto_append_file no value no value
auto_prepend_file no value no value
display_errors On On
display_startup_errors Off Off
extension_dir /usr/local/lib/php/extensions/no-debug-non-zts-20020429 /usr/local/lib/php/extensions/no-debug-non-zts-20020429
file_uploads On On
max_execution_time 50000 50000
max_input_time -1 -1
memory_limit 40M 40M
open_basedir no value no value
output_buffering 0 0
output_handler no value no value
post_max_size 8M 8M
safe_mode Off Off
safe_mode_exec_dir /usr/local/php/bin /usr/local/php/bin
safe_mode_gid Off Off
safe_mode_include_dir no value no value

And here's GD info
QuoteGD Support  enabled 
GD Version  2.0 or higher 
FreeType Support  enabled 
FreeType Linkage  with freetype 
GIF Read Support  enabled 
GIF Create Support  enabled 
JPG Support  enabled 
PNG Support  enabled 
WBMP Support  enabled

QuoteSERVER_SOFTWARE  Apache/1.3.33 (Unix)
PHP 4.4.4

Thanks in advance for any insights!
~Andrew~

Nibbler

Works fine on my gallery using that file, GD2 and the settings you mention in your post.

The error message about it being an invalid image is being reported directly by GD, so it is probably a server issue as opposed to a Coppermine issue.

imagecreatefromjpeg() [function.imagecreatefromjpeg]: 'albums/userpics/10001/P1170047.JPG' is not a valid JPEG file

Do you get the same problem if you attempt to FTP + batch add the file?

AndrewRH

No problems with that method - I can upload pictures and even large videos then have Coppermine add them without a problem.

So, I guess that means that it is a server issue.  The GD info shown under the PHP info (quoted in my previous post) appears satisfactory to me.  Is there something specific that I should ask 1&1 to adjust for me with G2? 

I realize this is now out of scope of Coppermine, but any tips from your experience would be appreciated.

Thanks once again, from a former dAlbums user,

~Andrew~
~Andrew~

Joachim Müller

Quote from: AndrewRH on November 03, 2006, 07:58:27 AM
No problems with that method - I can upload pictures and even large videos then have Coppermine add them without a problem.
You (as Coppermine admin) should use FTP-upload plus batch-add anyway. I guess there's little you could ask your webhost - you appear to be running into a time-out, so the image is only party transfered to the server and subsequently broken from the perspective of GD2.

Review the sticky thread on this sub-board to understand what server- or client-sided restrictions may apply.

AndrewRH

Yes, I agree.

One follow-up query: What Coppermine PHP file should I change to add extra information to the error that Coppermine displays?

That is, instead of just saying "The image you have uploaded is corrupted or can't be handled by the GD library", I would like to add what you just said, something like "Possible upload timeout - please upload a smaller version of the item".

Thanks again,

~Andrew~
~Andrew~

Joachim Müller

Edit lang/your_language.php (e.g. lang/english.php). In the future, please respect the "one question per thread" policy.