We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36549
    • 572 Posts
    Hi,

    Every time an image is uploaded to the assets/images directory or any directory contained within the asstest/images directory a thumbnail image is created with teh prefix .thumb_
    How can i stop this?

    Thanks for any help

    J
      www.9thwave.co.uk
         WEB | DESIGN | PRINT
      • 20413
      • 2,877 Posts
        @hawproductions | http://mrhaw.com/

        Infograph: MODX Advanced Install in 7 steps:
        http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

        Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
        http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        Just be aware that those thumbnails are necessary for the image browser to be able to display them.
          Studying MODX in the desert - http://sottwell.com
          Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
          Join the Slack Community - http://modx.org
          • 36549
          • 572 Posts
          Hi,

          Thanks MrHaw, i had already seen that post but it didn’t work. I added the word ’false’ and that doesn’t work either.
          The reason i need this to work is that there is a folder in images called ’random’ (..assets/images/random) which uses a random script (http://www.modxcms.com/forums/index.php?topic=10106) for images on the home page of a site.
          Of course because thumbnails are being generated too the random image displayed will be one of these and diaplay very pixellated.

          Any ideas how to overcome this?

          Thanks very much
            www.9thwave.co.uk
               WEB | DESIGN | PRINT
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            Actually if you’re using that snippet, it shouldn’t be happening:
            	
            if ( $file != '.' && $file != '..' && $is_image && substr($file,1,5)!='thumb')

              Studying MODX in the desert - http://sottwell.com
              Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
              Join the Slack Community - http://modx.org
              • 36549
              • 572 Posts
              hi sottwell,

              where is that code?

              Thanks
                www.9thwave.co.uk
                   WEB | DESIGN | PRINT
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                  Studying MODX in the desert - http://sottwell.com
                  Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                  Join the Slack Community - http://modx.org
                  • 36549
                  • 572 Posts
                  Ok, thanks.

                  When i add that code though i get the following error:
                  Parse error: syntax error, unexpected T_VARIABLE in /My Website/manager/includes/document.parser.class.inc.php(770) : eval()’d code on line 4

                  The code i have entered (which gives the above error) is:
                  <?php
                  $folder = 'assets/images/random';
                  $i = 0;
                  $imgDir = opendir ($folder);
                  	while ( $file = readdir( $imgDir ) )
                  	{	
                  		//checks that file is an image
                  		$file_type = strrchr( $file, "." );
                  		$is_image = eregi( "jpg|gif",$file_type );
                  		
                  		if ( $file != '.' && $file != '..' && $is_image && substr($file,1,5)!='thumb')
                  		{ $images[$i++] = $file; }
                  	}
                  closedir ($imgDir);
                  
                  srand( (double) microtime()*1000000 );
                  $image_name = $folder . '/' . $images[rand( 0,sizeof( $images ) -1 )];
                  $imgSize = GetImageSize( $image_name );
                  
                  //ends script if no images found
                  if ( $i == 0 )
                  	die();
                  return( "<img src=\"" . $image_name . "\"" . " alt=\"[*pagetitle*]\" class=\"home-image\"  />\n" );
                  ?>


                  The code i had previously that creates a thumb in the random directory was as follows:
                  <?php
                  $folder = 'assets/images/random';
                  
                  $i = 0;
                  $imgDir = opendir ($folder);
                  	while ( $file = readdir( $imgDir ) )
                  	{	
                  		//checks that file is an image
                  		$file_type = strrchr( $file, "." );
                  		$is_image = eregi( "jpg|gif",$file_type );
                  		
                  		if ( $file != '.' && $file != '..' && $is_image )
                  		{ $images[$i++] = $file; }
                  	}
                  closedir ($imgDir);
                  
                  srand( (double) microtime()*1000000 );
                  $image_name = $folder . '/' . $images[rand( 0,sizeof( $images ) -1 )];
                  $imgSize = GetImageSize( $image_name );
                  
                  //ends script if no images found
                  if ( $i == 0 )
                  	die();
                  return( "<img src=\"" . $image_name . "\"" . " alt=\"\" class=\"home-image\"  />\n" );
                  ?>


                  Is there a fix to this?

                  Thanks for any help
                    www.9thwave.co.uk
                       WEB | DESIGN | PRINT