We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 2747
    • 25 Posts
    When im trying to upload a picture, next error is coming:


    « MODx Parse Error »
    MODx encountered the following error while attempting to parse the requested resource:
    « PHP Parse Error »

    PHP error debug
    Error: imagecreatetruecolor() [function.imagecreatetruecolor]: Invalid image dimensions
    Error type/ Nr.: Warning - 2
    File: /home/minitex/www/site2/public_html/assets/snippets/maxigallery/watermark/Thumbnail.class.php
    Line: 359
    Line 359 source: $this->img["des"] = ImageCreateTrueColor($X_des,$Y_des);

    Parser timing
    MySQL: 0.0042 s (1 Requests)
    PHP: 0.0470 s
    Total: 0.0512 s



    How can i fix that?
      • 7923
      • 4,213 Posts
      What’s your snippet call and server specs?


        "He can have a lollipop any time he wants to. That's what it means to be a programmer."
        • 2747
        • 25 Posts
        I read the forum very attentively and find the discussion of similar trouble.
        You have talk with user "qniсk"

        ------------------------------------------------------------------
        Quote from: qnick on May 08, 2006, 04:59 AM
        Quote from: doze on May 08, 2006, 04:25 AM
        Quote from: qnick on May 08, 2006, 03:49 AM
        GD Support enabled
        GD Version bundled (2.0.28 compatible)
        ....
        So you have GD library enabled ok.. What’s the size of the pic you are trying to upload? What type is it, gif, png, jpg? Are you trying to upload multiple pictures at the same time? Have you tried with different/smaller pics? hmm.. well, answer to those first and I’ll think of more questions to ask

        I’m trying to upload this picture.
        Yes, I have tried with smaller pic.

        I’m sorry, but I don’t know what’s going on.. I thought that the pics would be corrupted somehow, because that can cause errors like this.. but they uploaded fine here. Have anyone else had problems like this?
        --------------------------------------------------------------------------------------------------------------

        My problem also with thumbnails.class.php and with the same provider (www.peterhost.ru) and i`m russian too. =))))))))))))))))))))))))))))
        I want to ask: did you find the desision for user "qniсk" or not. Thanks.
          • 7923
          • 4,213 Posts
          Could you link me to that post, can’t seem to remember what it was about..


            "He can have a lollipop any time he wants to. That's what it means to be a programmer."
            • 2747
            • 25 Posts
            Sorry for my previous message. Im explore the posts and think now that my trouble is not in exactly the same like "qnik".

            So... "let`s twist again" smiley

            My MG version: 0.5.2
            I have a GD library in version that be required
            The chmod for "galleries" 777 (i`m also tryed 755)

            My snippet call:

            [!MaxiGallery? &display=`childgalleries`!] - on the parrent page.

            [!MaxiGallery? &display=`embedded` &embedtype=`slimbox` &pics_per_row=`3`  &max_thumb_size=`110` &max_pic_size=`0` &thumb_use_dropshadow=`1`!] - on the childpages.

            When im tried to upload picture - the Parse error is coming (look at my first message).

            Then im go to ftp and look in galleries folder  (and have some interesting result)
            There is no folders in galleries, but if im will delete index.html and upload index.html again - the folder with pictures is show up!
            Then i can go to manage button and upload another picture, ant after that go to ftp and can`t seen new picture. But if i will delete previous picture - i will see the new picture. Good timespending! =))))))

            + after upload if i look at galleries in Modx file manager - i can see new folders and pictures

            Other buttons on MG interface is dosn`t working =)

            It` all information that i have. SOS. 
              • 7923
              • 4,213 Posts
              Quote from: banev at Feb 07, 2008, 02:24 AM

              Then im go to ftp and look in galleries folder (and have some interesting result)
              There is no folders in galleries, but if im will delete index.html and upload index.html again - the folder with pictures is show up!
              Then i can go to manage button and upload another picture, ant after that go to ftp and can`t seen new picture. But if i will delete previous picture - i will see the new picture. Good timespending! =))))))
              That probably happens because your FTP client is caching the directory contents and new files do not appear automatically, you need to refresh the view to see new files..

              Could you try changin &max_pic_size=`0` to for example &max_pic_size=`1000` and see what happens..


                "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                • 2747
                • 25 Posts
                absolutly same result
                and absolutly same result if totaly remove &max_pic_size from snippet
                and absolutly same result when im try tu use "resinch gallery" button
                button "delete all gallereis" is working good. I can delete uploaded pictures


                But, you was right about FTP Client. =)

                So have you any other ideas?
                  • 7923
                  • 4,213 Posts
                  What php version are you using? in 4.4.1, there is a bug relating to GD2 code that could result to this kind of an error.. http://bugs.php.net/bug.php?id=35071

                  But it could also be something else.. It could be that the file is not somehow uploaded / moved to right place or it gets corrupted or something and MaxiGallery is not able to get image size from the file. When you upload an image, what files comes to your server and where? What permissions comes to the files? are the files ok, eg. if you download them via FTP and view the images, do they open ok?


                    "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                    • 2747
                    • 25 Posts
                    Ok, let`s see... PHP Version 4.4.4

                    Now about files:
                    I`m suppose that the files uploaded in right place! In folder "galleries" - folders "2" and "3" (like ID of childpages) - so it`s ok?
                    The name and size of the files same like before uploading.

                    BUT,

                    You are absolutly right! The files is corrupted!
                    After download that files from FTP they don`t open! ACD See say`s "The sourse data format is not recognized!". And all other grafic programms too.

                    So, now we need to understand when it`s has corrupted. Do you need som other information?
                      • 7923
                      • 4,213 Posts
                      It could be that even though the pictures appear to be uploaded in full size, it could just have allocated that size file, but doesn’t actually upload it fully. The MaxiGallery can be hitting some server specific settings for max script execution time or something else..


                      Check these values from php.ini:

                      * max_execution_time, this is the maximum execution time allowed for each script, in seconds (it takes quite some time for maxigallery script to process the images if there are many of them and many imaging "filters" used).

                      * max_input_time, this is the maximum time each script may spend parsing request data, in seconds.

                      * memory_limit, this is the maximum amount of memory in megabytes that a script may consume (maxigallery keeps the images in memory while it makes thumbnails etc).

                      * post_max_size this is the maximum size of POST data in megabytes that PHP will accept (the pictures travel in the post data).

                      * upload_max_filesize this is the maximum allowed size for uploaded files in megabytes.

                      These settings can also be configured from Apache, so you might want to see if the following can be found from your httpd.conf:

                      * php_admin_value upload_max_filesize Sets the corresponding php setting, see above.

                      * php_admin_value post_max_size Sets the corresponding php setting, see above.

                      * php_admin_value memory_limit Sets the corresponding php setting, see above.

                      * LimitRequestBody Same as post_max_size php setting, but for apache.

                      Check, if included the GD library for the dynamic creation of images in php.ini.

                      * extension=php_gd2.dll (Windows) or extension=gd.so (Linux)


                        "He can have a lollipop any time he wants to. That's what it means to be a programmer."