title: Use the Image class of Prestashop in another directory
body: <p>I'm facing something that seems to be easy but I'm just stuck!</p>
  <p>I'm trying to use the <code>Image</code> class of Prestashop (in my script) to handle resizing of images. (to be used after).</p>
  <p>So,</p>
  <p><strong>My script is located under:</strong></p>
  <p><code>EDI/modules/Article</code></p>
  <p><strong>Picture class is under  <code>classes</code></strong></p>
  <p>So if I want to use the Picture class from my script I do this :</p>
  <pre><code>include_once (ROOT_PATH . '/config/config.inc.php');
  include_once (ROOT_PATH . '/classes/Image.php');
  </code></pre>
  <p>And that's where I'm stuck, php says :</p>
  <p><strong>Fatal error: Call to undefined method DB::getInstance() in ..../config/alias.php on line 65</strong></p>
  <p>This came from</p>
  <pre><code>function pSQL($string, $htmlOK = false)
  {
      // Avoid thousands of &quot;Db::getInstance()&quot;...
      static $db = false;
      
      if (!$db)
          $db = Db::getInstance(); &lt;============= HERE 
  
      return $db-&gt;escape($string, $htmlOK);
  }
  </code></pre>
  <p>Why ?? Isn't the include of config.inc.php is suppose to make it works ?</p>
  <p>I just want (from now) to be able to do something like :</p>
  <pre><code>$images_types = ImageType::getImagesTypes('products'); 
  var_dump($images_types);
  </code></pre>