Page 2 of 2 FirstFirst 12
Results 11 to 19 of 19
  1. #11
    Join Date
    Jun 2007
    Posts
    72
    Plugin Contributions
    0

    Default Re: Identifying and Removing Redundant Images

    Hi GSIS,

    I'm running into the same issue -- could I get a copy of that script you created to delete images that have been disabled or deleted? Would really appreciate it...I tried to create one based on the last accessed date in unix but since I backup the entire folder every night the time stamps are off.

    thanks,
    Don

  2. #12
    Join Date
    Dec 2005
    Posts
    77
    Plugin Contributions
    0

    Default Re: Identifying and Removing Redundant Images

    Does anyone know if this will work on 1.3.8a? I'd love to upgrade this site to the most current version, but the wish list module is a must have for my client and it doesn't work in newer versions.
    Thanks
    Jim

  3. #13
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Identifying and Removing Redundant Images

    Yes it will.
    But you should really be upgrading since your site has security problems when using that very old version.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  4. #14
    Join Date
    Nov 2007
    Location
    Sunny Coast, Australia
    Posts
    3,379
    Plugin Contributions
    9

    Default Re: Identifying and Removing Redundant Images

    ZC 1.5.1

    Ran this utility on the images folder - all ok, great script.

    My client's site has the product images organized in categories eg images/mens, images/sarongs, images/kaftans etc.

    Instead of changing the path to the directory to clean every time, would this work if I set

    Code:
    $imagedirectory = "images/*";
    so it checks and cleans all subdirectories in one cron run?

    If not, how could this be implemented?

  5. #15
    Join Date
    Dec 2010
    Location
    U.S. State of Texas
    Posts
    76
    Plugin Contributions
    0

    Default Re: Identifying and Removing Redundant Images

    Thank you so much for this plugin. I should have found this years ago. One question, when running the cron job, and viewing the files, I am noticing that the files displayed are the in the images folder. However I would like to clear out the LRG and MED images as well. Can you tell me what I am missing so that I can view the MED and LRG files since they are the real space hoggers on my server?

  6. #16
    Join Date
    Mar 2015
    Posts
    165
    Plugin Contributions
    0

    Default Re: Identifying and Removing Redundant Images

    Can we run this without a cron job. Just run it when we need to?

  7. #17
    Join Date
    Mar 2011
    Posts
    13
    Plugin Contributions
    0

    Default Re: Identifying and Removing Redundant Images

    I have run this as a job several times and get the same list of images. I note the description says it will "optionally" delete the images. How do I do that, or optionally, move them to a different directory where I can move all off the site?

  8. #18
    Join Date
    Nov 2005
    Posts
    86
    Plugin Contributions
    1

    Default Re: Identifying and Removing Redundant Images

    Hi, just found this script and I'm finding it useful for my site, but I have noticed the script is reporting some of my extra images (the ones named xx_01.jpg, xx_02.jpg) as being orphaned even if the main image and product is still used.

    So I've made a tweak to the code (see below) hope someone finds it useful!
    Please note, I've tested it on my site and it works but I've only one site to test on!
    It searches for underscore then 2 digits, so shouldn't affect image names containing underscores.


    Between line 109 and 110, add the preg_replace, this strips the numbers after the _ in the extra image names.

    PHP Code:
      // strip zen extra file upload underscaore and number
          
    if (preg_replace('/_[0-9]{2}/'''$subject)) {
           
    $subjectNew preg_replace('/_[0-9]{2}/'''$subject);
             } else {
              
    $subjectNew $subject;
             } 
    Then replace line 114 (change $subject to $subjectNew) so the query searches for the filename without the _ suffix and retains the $subject var for use further on in script.

    PHP Code:
    $result $db->Execute"SELECT products_id, products_status, products_image FROM " TABLE_PRODUCTS " WHERE products_image = '" zen_db_input($subjectNew ) ."'" ); 

  9. #19
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,696
    Plugin Contributions
    123

    Default Re: Identifying and Removing Redundant Images

    Follow ups to https://www.zen-cart.com/showthread....Support-Thread please.

    Image Purge has been updated to use the additional images processing from the core to identify (and not report as orphans) additional images.
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. Problem identifying where to make change -removing Cross Sell
    By fiberphile in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 8 Jan 2012, 11:18 PM
  2. Changing and removing images...
    By Amy Chomas in forum Templates, Stylesheets, Page Layout
    Replies: 9
    Last Post: 5 May 2011, 05:28 PM
  3. Identifying (and deleting) unused images
    By pharry in forum General Questions
    Replies: 2
    Last Post: 16 Nov 2009, 10:03 PM
  4. Removing redundant category from product listing?
    By yelow in forum Templates, Stylesheets, Page Layout
    Replies: 16
    Last Post: 4 Nov 2008, 07:31 PM
  5. help removing banner image and styling product images
    By BoYgAB90 in forum Basic Configuration
    Replies: 4
    Last Post: 28 Aug 2007, 12:31 AM

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
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR