We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14050
    • 788 Posts
    Maybe I am approaching it the wrong way and at a minimum not describing what I am trying to accomplish clearly. I have two types of images that I want to have a highslide added to. I have labels and bottles. I want the labels to have thumbnails created that are 25px wide with its height calculated by the original height/width so that it stays proportional. I want the bottles to have thumbnails created that are 175px in height and have the width calculated by the original height/width so that it stays proportional. Ideally, I would be able to add something inside the image tags to do this. Is this possible? Here is my current config file.

    <?php
    $tpl = <<<HTML
    @CODE:<a href="[+dr.bigPath+]" class="highslide" onclick="return hs.expand(this, {captionId: 'caption[+dr.id+]'})">
    	<img src="[+dr.thumbPath+]" width="[+dr.thumbWidth+]" height="[+dr.thumbHeight+]" /></a>
    <div class='highslide-caption' id='caption[+dr.id+]'>[+dr.originalWidth:gt=`[+dr.bigWidth+]`:then=`<a target="_blank" href="[+dr.originalPath+]">Open original ([+dr.originalWidth+]x[+dr.originalHeight+]) [+dr.originalFilesize+]</a>`+]
    </div>
    HTML;
    
    $header = <<<HTML
    <link rel="stylesheet" href="assets/plugins/directresize/highslide/style.css" type="text/css" media="screen" />
    <script type="text/javascript" src="assets/plugins/directresize/highslide/highslide.js.gz"></script>
    <script type="text/javascript">    
        hs.graphicsDir = 'assets/plugins/directresize/highslide/graphics/';
    	hs.outlineType = 'rounded-white';
    </script>
    HTML;
    
    $lightbox_mode = 2;
    
    $thumb_use_watermark = FALSE;
    $big_height = 1000;
    
    $thumb_default_width = 25;
    $thumb_default_height = 175;
    
    $allow_from="assets/images/products/";
    $resize_method = 2;
    ?>
    
      Jesse R.
      Consider trying something new and extraordinary.
      Illinois Wine

      Have you considered donating to MODx lately?
      Donate now. Every contribution helps.
      • 21101
      • 169 Posts
      Quote from: Metaller at Dec 10, 2007, 07:13 PM

      Hello.

      Yes, use "drthumbonly" label (see readme).

      1. Check your config file (default file is assets\plugins\directresize\configs\highslide.config.php) and set $thumb_use_watermark = FALSE; if your are no needs to use watermarks (magnifier as default image)

      2. In your documents add "drthumbonly" in any place to image tags, that you don’t need to add lightbox feature. For example:

      <img src="[+some_TV+]" width="100" height="100" drthumbonly/>

      Don’t worry about drthumbonly, it will be removed in the output.

      great, i think i’ll retry your plugin, the last time i tried, it deleted all my pics from the server grin
        Play no games
        • 19164
        • 1,215 Posts
        @Jesse R.
        It seems I am beginning to understand. You need to have some pictures with a given width, but others with a given height, right?

        But the main question still remained unanswered. How do you insert images in the document? From the TV of this document directly, or from TV but in the Ditto call, from TinyMCE manualy.

        If image tag have only height attribute - width will be calculated automatically, and if it have only width - height will be calculated. So, you need to point only one attribute (width or height) on each of your images.

        You don’t need $thumb_default_width and $thumb_default_height parameters in config, it will be work only if image tag have no width and height attributes (because default $thumb_default_sizemode = 1). And if it so, this thumb will be cropped strongly to size $thumb_default_width x $thumb_default_height.

        @negz
        Quote from: negz at Dec 11, 2007, 08:40 AM

        it deleted all my pics from the server grin

        Wow, how can this be? Plugin is creates it own cache and operating with it. Maximum that it can - delete all own cache files from assets/dlgallery folder. Please, describe it situation, it can be serious bug, if it is true.
          DirectResize 0.9 beta. PHPThumb, sets of configurations, configuration, binded to specific path. No backward compatibility. | DirectResize 0.9. PHPThumb, наборы параметров, параметры, привязанные к определенным путям. Без обратной совместимости.

          Unfortunately, DirectResize project is closed. If you want to continue development, PM me for access to project page on Google Code. К сожалению, проект DirectResize закрыт. Если вы желаете продолжить разработки, обращайтесь через ПМ для получения доступа к репозиторию на Google Code.

          [PLUGIN] DirectResize - as Maxigallery but for single images :: Download :: [url=http://modxcms.com/forums/index.php/topic,21490]
          • 14050
          • 788 Posts
          Ahh, that just solved it for me. I finally had my ah ha moment. So if I set a height attribute in my ditto call, DirectResize will calculate the width, and vice versa. Thanks Metaller! Now if I can just solve my issues with ManagerManager smiley
            Jesse R.
            Consider trying something new and extraordinary.
            Illinois Wine

            Have you considered donating to MODx lately?
            Donate now. Every contribution helps.
            • 21101
            • 169 Posts
            Quote from: Metaller at Dec 11, 2007, 02:42 PM


            @negz
            Quote from: negz at Dec 11, 2007, 08:40 AM

            it deleted all my pics from the server grin

            Wow, how can this be? Plugin is creates it own cache and operating with it. Maximum that it can - delete all own cache files from assets/dlgallery folder. Please, describe it situation, it can be serious bug, if it is true.

            in fact, in the config, instead of assets/drgalleries, i renamed assets/galleries grin
              Play no games
              • 32302
              • 3 Posts
              howdy and thank you for a fantastic plugin.

              Everything seems to work great and looks just the same. My one contention is that the images on the page are stripped of any alignment tags of the rendered pages, so images are always aligned to the left with text only above or below, but not wrapped to the left or right.

              When I analyze the page in the backend, the alignment tags are infact still there; they only disappear when displayed in the frontend.

              Is there a way to correct this? Perhaps I missed something in the documentation notes.
                • 19164
                • 1,215 Posts
                In current version there is only one way to align images - set in the source images class attribute and then use this class in the output template in [+dr.class+] placeholder.

                ie if source image is <img src="image.jpg" class="to_left" />, output template (lightbox) <a href=... rel="lightbox" ><img src="[+dr.thumbPath+] class="[+dr.class+]"></a>m you get <a href... rel="lightbox"><img src="thumb.jpg" class="to_left"/></a>
                  DirectResize 0.9 beta. PHPThumb, sets of configurations, configuration, binded to specific path. No backward compatibility. | DirectResize 0.9. PHPThumb, наборы параметров, параметры, привязанные к определенным путям. Без обратной совместимости.

                  Unfortunately, DirectResize project is closed. If you want to continue development, PM me for access to project page on Google Code. К сожалению, проект DirectResize закрыт. Если вы желаете продолжить разработки, обращайтесь через ПМ для получения доступа к репозиторию на Google Code.

                  [PLUGIN] DirectResize - as Maxigallery but for single images :: Download :: [url=http://modxcms.com/forums/index.php/topic,21490]
                  • 19164
                  • 1,215 Posts
                  New since 19-dec-2007
                  * fix with ftp commands
                  + new placeholders for style, align, valign of a source image
                  + absolute path for images is now supported and correctly works (File Manager Path in System configuration must be correctly set)
                  + New parameter $allow_from_allremote. This parameter allowed to use plugin on all images from remote sources w/o needed to list them all in $allow_from
                    DirectResize 0.9 beta. PHPThumb, sets of configurations, configuration, binded to specific path. No backward compatibility. | DirectResize 0.9. PHPThumb, наборы параметров, параметры, привязанные к определенным путям. Без обратной совместимости.

                    Unfortunately, DirectResize project is closed. If you want to continue development, PM me for access to project page on Google Code. К сожалению, проект DirectResize закрыт. Если вы желаете продолжить разработки, обращайтесь через ПМ для получения доступа к репозиторию на Google Code.

                    [PLUGIN] DirectResize - as Maxigallery but for single images :: Download :: [url=http://modxcms.com/forums/index.php/topic,21490]
                    • 19889
                    • 616 Posts
                    hello,

                    I just downloaded the latest version from the repository and I’m having some issues with the plugin - is it correct that the "cache" path "drgalleries" is hard coded into the script - like for instance here: if (strstr($path, "assets/drgalleries")) return true;


                    another question is regarding image sizes - let’s say I’d like to have big images of either 400x300 or if portrait 300x400 - is this possible?

                    thank you in advance for your input
                      • 19164
                      • 1,215 Posts
                      Hi.

                      The path to cache is realy hardcoded.

                      About big images - only thumbs is cropped if this set in configuration. Big image is reduced proportionately. So if original image is portrait - big image will be portrait too.

                      If you have any ideas or suggestions, please post it here.
                        DirectResize 0.9 beta. PHPThumb, sets of configurations, configuration, binded to specific path. No backward compatibility. | DirectResize 0.9. PHPThumb, наборы параметров, параметры, привязанные к определенным путям. Без обратной совместимости.

                        Unfortunately, DirectResize project is closed. If you want to continue development, PM me for access to project page on Google Code. К сожалению, проект DirectResize закрыт. Если вы желаете продолжить разработки, обращайтесь через ПМ для получения доступа к репозиторию на Google Code.

                        [PLUGIN] DirectResize - as Maxigallery but for single images :: Download :: [url=http://modxcms.com/forums/index.php/topic,21490]