Full service web hosting, great prices and support. Starts at $1.99/month!
Results 1 to 9 of 9

Thread: pictures without extension in admin panel

  1. #1
    Motive
    Guest


    Default pictures without extension in admin panel

    I am on oscMax 2.025.
    I have just installed this and have been setting it up.
    I used easy populate to load my products and image references. And then used FTP to load my big images and thumbs to their respective folders.
    Today I am looking through my admin section (renamed) and I found 32 files without extensions following this naming pattern "pThumbfG4UUn". I downloaded one and put jpg extension on it and it is an image of my product.

    Question is where did they come from and why?

  2. #2
    osCMax Development Team

    pictures without extension in admin panel

    ridexbuilder's Avatar
    Join Date
    Jul 2008
    Location
    Haggisland
    Posts
    4,164
    Contribute If you enjoy reading the
    content here, click the below
    image to support our site.
    Click Here To Contribute To Our Site

    Total Contributions For

    ridexbuilder     $ 15.00
    Rep Power
    99


    Lightbulb Re: pictures without extension in admin panel

    This is a known 'issue'.
    Remove (delete) them all, then change permissions of your admin directory to to read-only eg. 555
    It's caused by the caching of thumbnails during the image resize feature in the product admin. This is addressed in SVN r674 (Developers section above).

    catalog/ admin/ includes/ functions/ instant_update.php

    Line 12
    Code:
      $cache_dir = 'cache/';
    Line 51
    Code:
                            $phpThumb->setParameter('config_cache_directory', $cache_dir);
    Line 89
    Code:
                            $phpThumb->setParameter('config_cache_directory', $cache_dir);
    Note your version may not have the same line numbers above and only one copy of the $phpThumb->setParameter directive. Take a backup of the file and alter the code so that it appears the same as above.

    The one advantage of installing from the latest SVN - you get bug fixes and feature enhancements already installed.

    Developers resource at bitbucket
    *** *** ***
    oscmax.co.uk / ejsolutions.co.uk
    Hosting plans with installation, configuration, contributions, support and maintenance.
    *** FREE osCmax hosting available ***
    oscmaxtemplates.com

  3. #3
    Motive
    Guest


    Default Re: pictures without extension in admin panel

    ya so I only have one instance of
    PHP Code:
    $phpThumb->setParameter('config_cache_directory'$cache_dir); 
    and that is on line 51. Commented next to it was "this doesn't work"
    I added the line to 12. I only go up to Line 81. So this is what I ended up with

    PHP Code:
    <?php
      $images_dir 
    DIR_WS_IMAGES// default catalog images folder;
      
    $exclude_folders = array("banners","default","icons","mail","infobox","js"); // folders to exclude from adding new images
      
    $root_images_dir DIR_FS_CATALOG .  $images_dir DYNAMIC_MOPICS_BIGIMAGES_DIR;
      
    $root_thumbs DIR_FS_CATALOG $images_dir DYNAMIC_MOPICS_THUMBS_DIR;
      
    $html_images_dir =  DIR_WS_CATALOG .  $images_dir DYNAMIC_MOPICS_BIGIMAGES_DIR;
      
    $html_thumbs =  DIR_WS_CATALOG .  $images_dir DYNAMIC_MOPICS_THUMBS_DIR;  
      
    $new_dir preg_replace('/[^a-zA-Z0-9_.-]/i''_',$_POST['new_directory']); 
      
    $dir = (tep_not_null($new_dir) ? $new_dir $_POST['directory']);
     
    // instant update 
       
    if ($action == 'new_product_preview') {
        
    $cache_dir 'cache/';  //added this to solve a cached thumbnail problem
     
    // copy image only if modified
            
    if ($dir && !is_dir($root_images_dir $dir)) { 
           if (
    mkdir($root_images_dir $dir)) $messageStack->add('Folder ' $dir ' created in '$root_images_dir '.''success');
        }
            if (
    $dir && !is_dir($root_thumbs $dir)) { 
           if (
    mkdir($root_thumbs $dir)) $messageStack->add('Folder ' $dir ' created in '$root_thumbs '.''success');
        }    
            
    $products_image = new upload('products_image');
            
    $products_image->set_destination($root_images_dir . ($dir $dir .'/' ''));
     
            if (
    $products_image->parse() && $products_image->save()) {
              
    $products_image_name =  ($dir $dir '/' '') . $products_image->filename;
    require_once( 
    DIR_FS_CATALOG 'ext/phpthumb/phpthumb.class.php');
    // create phpThumb object
    $phpThumb = new phpThumb();
    // create 2 sizes of 'thumbnail'
    // Note: thumbnail referenced below applies to both image sizes.
    $thumbnails = array(PRODUCT_IMAGE_WIDTH => $root_thumbsPOPUP_IMAGE_WIDTH => $root_images_dir);
    foreach (
    $thumbnails as $thumbnail_width => $dest_dir) {
     
    // this is very important when using a single object to process multiple images
     
    $phpThumb->resetObject();
    // set data source -- do this first, any settings must be made AFTER this call
    if (is_uploaded_file(@$_FILES['userfile']['tmp_name'])) {
     
    $phpThumb->setSourceFilename($_FILES['userfile']['tmp_name']);
      
    $output_filename $dest_dir $dir .basename($_FILES['userfile']['name']).'_'.$thumbnail_width.'.'.$phpThumb->config_output_format;
    } else {
     
    $phpThumb->setSourceData(file_get_contents($root_images_dir $products_image_name));
     
    $output_filename $dest_dir $products_image_name;
    }
    // set parameters (see "URL Parameters" in phpthumb.readme.txt)
    $phpThumb->setParameter('config_cache_directory'$cache_dir); //took out "DIR_FS_CATALOG . 'cache/'" and replaced with $cache_dir to fix a thumbnail cache problem
    $phpThumb->setParameter('w'$thumbnail_width);
    if (
    $dest_dir $root_images_dir) { 
     
    $phpThumb->setParameter('h'POPUP_IMAGE_HEIGHT);  //specify max height for popup
     
    $phpThumb->setParameter('q'90);  //maintain higher quality for popup
     
    }
    // generate & output thumbnail
    if ($phpThumb->GenerateThumbnail()) { // this line is VERY important, do not remove it!
     
    if ($phpThumb->RenderToFile($output_filename)) {
      
    // do something on success
     
    } else {
      
    // do something with debug/error messages
      
    echo 'Failed:<pre>'.implode("nn"$phpThumb->debugmessages).'</pre>';
     }
    } else {
     
    // do something with debug/error messages
     
    echo 'Failed:<pre>'.$phpThumb->fatalerror."nn".implode("nn"$phpThumb->debugmessages).'</pre>';
    }
    }
    // end thumbnail creation                
            
    } else {
              
    $products_image_name = (isset($HTTP_POST_VARS['products_previous_image']) ? $HTTP_POST_VARS['products_previous_image'] : '');
            }
     if (
    $_POST['instant_update'] == 'on') { 
       
    $_POST['products_image'] = stripslashes($products_image_name);
            
    $action = (isset($_GET['pID']) ? 'update_product' 'insert_product');  
     }
    }
    ?>
    Now once this is done can I change my admin back to 755 or should I leave it at 555?

  4. #4
    Motive
    Guest


    Default Re: pictures without extension in admin panel

    After I posted this I was looking at r674. should I delete everything that is in red?

  5. #5
    osCMax Development Team

    pictures without extension in admin panel

    ridexbuilder's Avatar
    Join Date
    Jul 2008
    Location
    Haggisland
    Posts
    4,164
    Contribute If you enjoy reading the
    content here, click the below
    image to support our site.
    Click Here To Contribute To Our Site

    Total Contributions For

    ridexbuilder     $ 15.00
    Rep Power
    99


    Post Re: pictures without extension in admin panel

    Move
    Code:
    $cache_dir = 'cache/'; 

    to below
    Code:
    $dir = (tep_not_null($new_dir) ? $new_dir : $_POST['directory']);

    (Keeps it closer to the corrected file, if you look at the SVN.)
    Keep the admin directory at 555 ('safer' anyway)
    You may need to create public_html/cache and or catalog/youradmin/cache, depending on your server environment.

    Remember the 'Thanks' button


    Developers resource at bitbucket
    *** *** ***
    oscmax.co.uk / ejsolutions.co.uk
    Hosting plans with installation, configuration, contributions, support and maintenance.
    *** FREE osCmax hosting available ***
    oscmaxtemplates.com

  6. #6
    osCMax Development Team

    pictures without extension in admin panel

    ridexbuilder's Avatar
    Join Date
    Jul 2008
    Location
    Haggisland
    Posts
    4,164
    Contribute If you enjoy reading the
    content here, click the below
    image to support our site.
    Click Here To Contribute To Our Site

    Total Contributions For

    ridexbuilder     $ 15.00
    Rep Power
    99


    Exclamation Re: pictures without extension in admin panel

    Quote Originally Posted by Motive View Post
    After I posted this I was looking at r674. should I delete everything that is in red?
    Given that you're a relative newbie, that may get too complex.
    (You need to add as well as remove.)

    "this doesn't work"
    My comment, BTW.

    Developers resource at bitbucket
    *** *** ***
    oscmax.co.uk / ejsolutions.co.uk
    Hosting plans with installation, configuration, contributions, support and maintenance.
    *** FREE osCmax hosting available ***
    oscmaxtemplates.com

  7. #7
    osCMax Development Team

    pictures without extension in admin panel

    ridexbuilder's Avatar
    Join Date
    Jul 2008
    Location
    Haggisland
    Posts
    4,164
    Contribute If you enjoy reading the
    content here, click the below
    image to support our site.
    Click Here To Contribute To Our Site

    Total Contributions For

    ridexbuilder     $ 15.00
    Rep Power
    99


    Default Re: pictures without extension in admin panel

    Additional note for the curious...
    This file may get another makeover (if I can be bothered), to take advantage of the new image generator feature in 2.1
    It will considerably clean up the file and make is a lot simpler to follow - don't hold yer breath.

    Developers resource at bitbucket
    *** *** ***
    oscmax.co.uk / ejsolutions.co.uk
    Hosting plans with installation, configuration, contributions, support and maintenance.
    *** FREE osCmax hosting available ***
    oscmaxtemplates.com

  8. #8
    Motive
    Guest


    Default Re: pictures without extension in admin panel

    Quote Originally Posted by ridexbuilder View Post
    Given that you're a relative newbie, that may get too complex.
    I've never had a problem using the delete key before.

    Thanks

  9. #9
    osCMax Development Team

    pictures without extension in admin panel

    ridexbuilder's Avatar
    Join Date
    Jul 2008
    Location
    Haggisland
    Posts
    4,164
    Contribute If you enjoy reading the
    content here, click the below
    image to support our site.
    Click Here To Contribute To Our Site

    Total Contributions For

    ridexbuilder     $ 15.00
    Rep Power
    99


    Default Re: pictures without extension in admin panel

    Last edited by ridexbuilder; 10-17-2010 at 09:26 AM.

    Developers resource at bitbucket
    *** *** ***
    oscmax.co.uk / ejsolutions.co.uk
    Hosting plans with installation, configuration, contributions, support and maintenance.
    *** FREE osCmax hosting available ***
    oscmaxtemplates.com

Similar Threads

  1. Conflicts with pdo extension and pdo_mysql extension?
    By minuteman1970 in forum osCmax v2 Installation issues
    Replies: 1
    Last Post: 09-13-2010, 05:59 AM
  2. New Look for Admin Panel - Blue
    By michael_s in forum New osCommerce Contributions
    Replies: 0
    Last Post: 01-25-2010, 08:00 AM
  3. Admin Panel Access
    By Vince in forum osCmax v2 Installation issues
    Replies: 6
    Last Post: 11-25-2009, 12:11 PM
  4. Admin Panel Issue
    By fpgibb in forum osCMax v1.7 General Mods Discussion
    Replies: 0
    Last Post: 03-29-2008, 12:36 AM
  5. my admin panel is all screwed up!
    By chuan in forum osCmax v2 Installation issues
    Replies: 1
    Last Post: 10-07-2006, 06:29 PM

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •