We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 13428 ☆ A M B ☆
    • 1,031 Posts
    I’ve made a few modifications to get a format-conversion for the thumbnails by phpThumb in directResize.php:

    Line 46:
          "thumb_format"            => '',


    Lines 413ff:
    	function PHPThumbQueryStr()
    	{
    		global $PHPTHUMB_CONFIG, $modx;
    		@require_once($modx->config["base_path"].PHPTHUMB_PATH."phpThumb.config.php");
    		
    		$path_info = pathinfo($this->current["source"]["src"]);
    		
    		$format = strtolower($path_info["extension"]);
    		$format = ($format == "jpeg") ? "jpg" : $format;
    	  $format = ($this->current["config"]["thumb_format"] != "") ? $this->current["config"]["thumb_format"] : $format;
    		
    		$this->current["phpthumb_parms"]["f"] = $format;
    		
    		if ($this->current["process_mode"] == "thumb") 
    		{
    			$prefix = "thumb_";
    			if ($format == "jpg")
            $this->current["phpthumb_parms"]["q"] = $this->current["config"]["thumb_quality"];
    			$phpthumb_parms_name = "thumb_phpthumb_parms";
    		}
    		else
    		{
    			if ($format == "jpg")
            $this->current["phpthumb_parms"]["q"] = $this->current["config"]["big_quality"];
    			$phpthumb_parms_name = "big_phpthumb_parms";
    		}
    		
    		$this->current["phpthumb_parms"]["sia"] = $prefix.basename($this->current["source"]["src"], $path_info["extension"]) . $format;
    
    		$format = ($format == "jpg") ? "jpeg" : $format;
    


    Maybe this is useful for someone else.

      • 26931
      • 2,314 Posts
      Hi everybody,

      ...and thank you Metaller for that great plugin!

      i’ve got gone question though  smiley how can i archive to keep the original size of the big image, that shows up in the Lightbox?

      i’ve tried to set $dr_local [ "big_width"] [ "all"] = 2000; in my config-file, but the big image will still be cached 935px wide, i’ve read somewhere in this thread, that you’ve got to set the size very high, in order too keep the original size...i use slimbox btw.

      thanks & regards, j

      *edit: okay, i’ve found out, that if i set:

      $dr_local [ "big_resize_method"] = 1;
      $dr_local [ "big_width"] [ "all"] = 2000;

      in the config-file, my big image keeps it size smiley
        • 4414
        • 63 Posts
        Hi Metaller,

        After upgrading to MODx evolution (MODx 1.0) everything is working fine except for DirectResize.

        Do I have to change a path somewhere or is the current version of DirectResize not compatible to MODx evolution?

        Looking forward to your reply,

        Stefan
          • 19164
          • 1,215 Posts
          Hello.

          @Stefan I’ve not tested the new version yet. May be someone else can help right now.

          @sharkbait You’re welcome!
            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]
            • 26931
            • 2,314 Posts
            hi there,

            ups...got a little problem here smiley

            if the site is first cached when it’s called via http://domain.com/subdirectory it won’t show the direct resize pictures when the site is called with http://www.domain.com/subdirectory

            has anyone come across this problem?

            thanks, j
              • 19164
              • 1,215 Posts
              Hi,

              someone reported about such problem early.

              Try to use www.domain to domain rewrite rule in .htaccess.
                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]
                • 26931
                • 2,314 Posts
                Try to use www.domain to domain rewrite rule in .htaccess.

                smiley i did that, just wanted to check if i’ve missed something in the configuration...

                thanks, j
                  • 4414
                  • 63 Posts
                  Could you post this rewrite rule here and tell me where to place it in .htaccess?

                  Thanks in advance!
                    • 26931
                    • 2,314 Posts
                    Could you post this rewrite rule here and tell me where to place it in .htaccess?

                    Hi Bytesource,
                    for an installation in the server root, uncomment the last 3 lines, so that it looks like this:

                    # for the opposite domain.com -> www.domain.com use the following
                    # >>> DO NOT USE BOTH THE ABOVE AND BELOW <<<
                    #
                    RewriteCond %{HTTP_HOST} .
                    RewriteCond %{HTTP_HOST} !^www\.yourdomain\.com [NC]
                    RewriteRule (.*) http://www.yourdomain.com/$1 [R=301,L]


                    j
                      • 4414
                      • 63 Posts
                      Hi sharkbait,

                      Thanks for your clear explanation!

                      Best regards,

                      Stefan