Jump to content

[Solved] Image Regeneration NOT through Back Office


Shaun

Recommended Posts

Your signature says that you are using PrestaShop v1.3.1. Why don't you use the resume option? Just uncheck "Erase previous images" and then thumbnail regenerated will resume where it stopped after 2 minutes.

The only other way is to use Photoshop or another program to batch resize your images, then upload them using FTP.

Link to comment
Share on other sites

@ Rocky,

You're right, I tried this after I posted question, exploring various options. After the server first timeout, I unchecked the "Erase previous images”, it managed to complete after I specifically selected "Facebook New" from the drop down menu. This was specifically for the new Facebook image dimensions. I did not see any change immediately after checking my Facebook page (even after clearing the cache), but will troubleshoot step by step tomorrow and update accordingly.

  • Like 1
Link to comment
Share on other sites

So, an FYI for all the users who did not know this. With ver 1.3.1, you are able to a specific "Select Image" for the thumbnails you wish to regenerate. For example, I wanted to regenerate my "Facebook New" size that I had assigned to my products and categories.
I chose "products" from the "Select Image" drop down menu and hit Regenerate Thumbnails. When I received a server timeout error (most host providers will have a timeout limit for security reasons), I unchecked the "Erase Previous Images" box, and Regenerated Thumbnails again. I had to do this a few times before the operation was completed successfully, but it worked in the end.

29499_w5ogZS3N0Nbn2NnGLttM_t

Link to comment
Share on other sites

  • 3 weeks later...

You can also increase the server's MySQL session 'wait_time' for the session - if your host allows it.

In Classes/MySQL.php, you can add the following mysql_query in the connect() function:

class MySQL extends Db
{
   public function    connect()
   {
       if (!defined('_PS_DEBUG_SQL_'))
           define('_PS_DEBUG_SQL_', false);
       if ($this->_link = @mysql_connect($this->_server, $this->_user, $this->_password))
       {
           if(!$this->set_db($this->_database))
               die(Tools::displayError('The database selection cannot be made.'));
       }
       else
           die(Tools::displayError('Link to database cannot be established.'));

//  *********  Modded - un-commenting the mysql_query line will increase the wait_timeout on the server for thumbnail regeneration  ******** //

       // 720 seconds = 12 mins, enough for c. 1000 images (50 images (600px jpg's) took 33 secs during testing)

   //    mysql_query('SET SESSION wait_timeout = 720', $this->_link);

//  *********  /  Modded - un-commenting the mysql_query line will increase the wait_timeout on the server for thumbnail regeneration  ******** //

       /* UTF-8 support */
       if (!mysql_query('SET NAMES \'utf8\'', $this->_link))
           die(Tools::displayError('PrestaShop Fatal error: no utf-8 support. Please check your server configuration.'));
       /* Disable some MySQL limitations */
       mysql_query('SET GLOBAL SQL_MODE=\'\'', $this->_link);
       return $this->_link;
   }



Although you might want to uncomment that line only when you're regenerating thumbnails, otherwise it's likely to apply to every MySQL connection your shop makes, not just the one to regenerate thumbnails.

Link to comment
Share on other sites

  • 4 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...