We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7923
    • 4,213 Posts
    Quote from: multiverso at Jul 07, 2006, 05:11 AM

    Could you check your GD library version from PHP info and maybe put it visible somewhere for me to look at. You can find php info at the modx manager by looking to Administration -> View system info -> View link at phpinfo().

    Please check http://www.multiverso.com/phpinfo, you can see the the phpinfo there.

    Your phpinfo looks very similar to mine, I have same GD settings and version.. something else going on here..

    Ah.. peeked at the code and I think I know what’s going on.. open the functions.php file for editing and search this:

    function createthumb($filename,$filetype,$path_to_gal,$prefix="",$mgconfig,$resize=true) {


    after that line, add global $modx; so it becomes:

    function createthumb($filename,$filetype,$path_to_gal,$prefix="",$mgconfig,$resize=true) {
    	global $modx;


    Please report back with results..


      "He can have a lollipop any time he wants to. That's what it means to be a programmer."
      • 20621
      • 8 Posts
      Ah.. peeked at the code and I think I know what’s going on.. open the functions.php file for editing and search this:

      function createthumb($filename,$filetype,$path_to_gal,$prefix="",$mgconfig,$resize=true) {


      after that line, add global $modx; so it becomes:

      function createthumb($filename,$filetype,$path_to_gal,$prefix="",$mgconfig,$resize=true) {
      	global $modx;


      Please report back with results..

      I have added "global $modx;" as you said, but still can get the dropshadow to work sad
        • 21075
        • 24 Posts
        This is because you have php safe mode restrictions on the server (for openbase dir, i guess). There isn’t really a fix for this, but you can get around it. Look for instructions here.

        Thanks for the quick reply, doze. So quick I didn’t even see it right away. The method you describe isn’t actually working for me, though. I guess I’ll have to tryto find a new hositng solutions if want to make this work.

        Thanks anyway.
          • 20621
          • 8 Posts
          Ok, thanks to hexagon I found what’s happening: the settings like dropshadow, imagemask and watermarking are only applied to the images AT THE MOMENT that you upload them, not AFTER you have uploaded them. You need to have these settings already in place in your page, and then upload the pictures. If you have already uploaded the pictures and then you decide you want a drop shadow changing the settings of the gallery will be useless, you need to reupload again the pictures.

          Is this the way the snippet was designed, or it is a malfuncion on my server/webiste? It would be a little annyoing that after uploading 100 photos I could to change the watermark for example and be forced to reupload everything...
            • 33372
            • 1,611 Posts
            I assume that’s the way it’s designed, since it works with the GD library (which does this). I guess you could modify the snippet to save an original fullsize version with no watermark or dropshadow and add a button to the interface to reprocess those images according to new settings. You could do the same thing with thumbnail scaling, etc.

            Although I don’t think that most people would need this functionality, it could be done...

            If you’re going to be changing your image format frequently maybe you’d be better off batch processing them locally and then uploading them via FTP.
              "Things are not what they appear to be; nor are they otherwise." - Buddha

              "Well, gee, Buddha - that wasn't very helpful..." - ZAP

              Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options
              • 25663 MODX Staff
              • 12,272 Posts
              That actually sounds like a cool idea to me (saving a "base" file). In addition, I’m really looking forward to being able to parse a directory full of images that have been FTP’d up to a server rather than parsed one-by-one via an upload dialog.
                Ryan Thrash, MODX Co-Founder
                Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                • 33372
                • 1,611 Posts
                Here’s an article I happened upon that describes how to batch create thumbnails. Adding a drop shadow and/or watermark would be just as easy. I think you could create a simple form into which you enter your config values and just press Go.

                http://icant.co.uk/articles/phpthumbnails/
                  "Things are not what they appear to be; nor are they otherwise." - Buddha

                  "Well, gee, Buddha - that wasn't very helpful..." - ZAP

                  Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options
                  • 7923
                  • 4,213 Posts
                  Quote from: multiverso at Jul 08, 2006, 02:07 AM

                  Ok, thanks to hexagon I found what’s happening: the settings like dropshadow, imagemask and watermarking are only applied to the images AT THE MOMENT that you upload them, not AFTER you have uploaded them.
                  ...
                  Is this the way the snippet was designed, or it is a malfuncion on my server/webiste? It would be a little annyoing that after uploading 100 photos I could to change the watermark for example and be forced to reupload everything...
                  Yes, this is the way the snippet is currently designed to work. Sorry. I have allready planned to start using phpThumb with MaxiGallery which handles all the image altering and saves it pictures to a cache. The original picture stays intact with no altering done. You could then use the same "base" image in multiple galleries with different sizes/filtering and change the size/watermarks/shadows at anytime for any picture/gallery. But no work is done for this yet.. There will be a new release very soon what has bugfixes and some cool new features like templating. After this, I (or Marc, if he’s up to it) start to work with the phpThumb.

                  @rthrash and ZAP
                  Batch assigning pictures to a gallery from allready uploaded files is also planned. This will come with the phpThumb enabled release..


                    "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                    • 33372
                    • 1,611 Posts
                    Sounds like you’re more than on top of this, as usual.
                      "Things are not what they appear to be; nor are they otherwise." - Buddha

                      "Well, gee, Buddha - that wasn't very helpful..." - ZAP

                      Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options
                      • 20621
                      • 8 Posts
                      Thanks doze, it seems you have everything under control! I’m sure MaxiGallery will be THE gallery snippet of ModX, and the envy of many CMS/Blog tools.

                      Thanks again, your hard work is very appreciated. smiley

                      This discussion is closed to further replies. Keep calm and carry on.