We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10313
    • 375 Posts
    Rzhik, did you add this to you .htaccess?
    # DirectResize  Friendly URLs part
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^images/([a-z0-9]{32})/.*\.(png|gif|jpe{0,1}g)$ assets/plugins/directresize/furl.php?q=$1 [NC,L,QSA]



    Info to my post above regarding thickbox: I have replaced too many "$"s. The thickbox.js has a regular expression with "$" as line-end symbol. I had replaced them, too, beacause I replaced all occurences. I changed that back to "$", and now it works fine smiley
      • 23510
      • 168 Posts
      Quote from: rzhik at Jan 27, 2010, 10:23 AM

      Quote from: FuryDE at Jan 27, 2010, 10:06 AM

      Are the thumbnaisl not visible, either?

      Do you have a writeable folder [tt]/assets/drgalleries[/tt]? Did you upload the [tt]image.php[/tt] to your MODX root directory?

      Yes, I uploaded it. phpThumb create thumbnails and they are in assets/snippets/phpthumb/cache folder, but they are not visible and enlarge images too.

      Check to make sure you have image.php inside your site root. This exact thing was happening to me and that was the problem.
        • 17460
        • 14 Posts
        Hi

        I can’t bring this plugin to work here. Did all the steps as described in the first post of this thread. The thing I’m not sure about is the rewrite-rule. We work with an IIS Server (so i can’t work with a htaccess files) - the rewrite rule looks like this:
        <?xml version="1.0" encoding="UTF-8"?>
        <configuration>
            <system.webServer>
        	<rewrite>
                    <rules>
                        <clear />
                        <rule name="modx directResize" stopProcessing="true">
                            <match url="^images/([a-z0-9]{32})/.*\.(png|gif|jpe{0,1}g)$" />
                            <conditions logicalGrouping="MatchAll">
                                <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                            </conditions>
                            <action type="Rewrite" url="assets/plugins/directresize/furl.php?q={R:1}" />
                        </rule>
                    </rules>
                </rewrite>
            </system.webServer>
        </configuration>

        Has anyone running the plugin on an IIS 7 server? Is the rewrite rule ok? // edit: yes it works!


        I don’t know if it has anything to do with the rewrite rule. With the plugin activated several errors in the fron- & backend sho up. Image wich should be resized look like this in the frontend:
        <a href="images/1d921c9a8ca267852a5261c800362d15/xycqp_avo_aytful19.jpg" title="" class="thickbox">
        	<img src="images/76e0dd057a270aaeedc581b72e7cea46/thumb_xycqp_avo_aytful19.jpg" width="100" style="float:left;">
        ...i think there is something wrong with the paths. Those files are not in the assets/images folder and not in the root as the link suggests. // rewrite works now!


        Or can it be a problem with php 5.3? Anyone works with the latest php version?


        //edit
        :
        now I’m a little step further:

        • i saw that the phpThumb script (phpThumb.php) throws an error on line 160
        • i followed the recommendation in that codeline and changed my config to allow this thing: $PHPTHUMB_CONFIG[’allow_local_http_src’] = true;
        • now i can see error-images from the phptumb-script on my frontend. they look like this one:
        • because i see the error image now i guess that the rewrite-rule is okay and works, else the plugin would never start to process the image?

        ---> But what exactly is wrong with the phpThumb calls? Any Ideas?
        ... is there a way to get better error messages out of phpthumb?
          • 17460
          • 14 Posts
          Okay it works now. It didn’t before for two reasons:

          • phpThumb uses some php-functions which are depreceated in PHP 5.3. But someone allready created a compatible version here: http://modxcms.com/forums/index.php/topic,19236.msg234871.html#msg234871
          • the other failure appears because i’m using a testserver now. the website-files are stored in a windows-unc path. and it looks as if the php is_dir & is_file function are not working correctly with UNC paths. and because phpThumb uses those functions, the source-images can’t be found.
            my solution is a little workaround in the phpThumb config. It forces the script to use the http://... path instead of the local realtive path. then the script operates as it should.
          $PHPTHUMB_CONFIG['allow_local_http_src']         = true; // If true, 'src' parameter can be "http://<thishostname>/path/image.ext" instead of just "/path/image.ext"; if false then display warning message to encourage more efficient local-filename calling.
          
          // END USER CONFIGURATION SECTION
          
          // append full http url to relative source-path:
          // workaround for problems with UNC paths!
          if (isset($_GET['src'])){
          	if (substr($_GET['src'],0,14) == 'assets/images/'){
          		$_GET['src'] = 'http://'.$_SERVER['HTTP_HOST'].'/'.$_GET['src'];
          	}
          }
            • 38755
            • 43 Posts
            A heads up to anyone using DR and also outputting any markup tags that are case sensitive (such as <pubDate> in RSS feeds), a library called by DR defaults to converting all markup tags to lowercase. In order to get my Ditto generated RSS feed to validate I had to make a minor adjustment to DR, so that it calls this library with the lowercase config turned off:

            In assets/plugins/directresize/directResize.php edit (around line 562, inside the _setCSSBindingLabel function)
            $html = new simple_html_dom();
            $html->load($content);
            

            to this:
            $html = new simple_html_dom();
            $html->load($content, false);
            


            Super simple fix, but took a while to isolate and locate the source of the problem since ALL markup output by MODx was affected. Hopefully this saves someone else some frustration.
              • 22827
              • 129 Posts

              If directresize is no longer supported, has anyone found a good alternative?

              I realise that dr is still good nonetheless.

              T
                • 27749
                • 53 Posts
                Hi,

                when having a lot of content entered including html tags and direct resize plugin active - the document renders blank. Does anyone have/had the same issue? Is there any workaround besides disabeling DR.
                I love DR, but have no idea where a limitation could be set.

                THX
                Smiley
                  • 22827
                  • 129 Posts

                  Any errors in the system event log?
                    • 27749
                    • 53 Posts
                    Unfortunately nothing.
                    I tried to change the execution order without any luck.
                    It fails on OnWebPagePrerender - even with PHX disabled.
                    This is the exact page: http://lidemesta.cz/new/index.php?id=39 DR is disabled right now sad
                      • 16610
                      • 634 Posts
                      @smiley: How much content do you have and how big the original images are?
                        Mikko Lammi, Owner at Maagit