title: base path for images
body: <p>I fixed my problem with the loading times of my pictures, but now the images don't show up on my production system.</p>
  
  <p>My images are in this directory: <code>\public\images\logos</code>
  At my localhost environment the following paths are working I see the images in my pdf:</p>
  
  <pre><code>images/logos/*.*
  /images/logos/*.*
  ./images/logos/*.*
  </code></pre>
  
  <p>If I use the same controller action on the production system, I get an error:</p>
  
  <blockquote>
    <p>Message: Cannot create image resource. File not found.</p>
  </blockquote>
  
  <p>I tried all varieties shown above.</p>
  
  <p>How and where can I set something like an base path for the images and how do I have to name my relative paths in my database?</p>
  
  <p>Additional information:</p>
  
  <p>I try to get the images like this: </p>
  
  <pre><code>$pfad = $logen-&gt;logo ;  
  //$pfad=trim($pfad);
  //$page-&gt;drawText($pfad, $posX, $posY +11,'UTF-8');
  $image = Zend_Pdf_Image::imageWithPath($pfad);  //Image mit präfix .)/ läuft auf localhost
  $page-&gt;drawImage($image, $posX-30, $posY, $posX, $posY+30);
  </code></pre>
  
  <p>This works on localhost, but not on my production system, if I replace the path from the database with an absolute path like this:</p>
  
  <pre><code>$pfad='./images/fgld.jpg';
  </code></pre>
  
  <p>it works! If I put <code>./images/fgld.jpg</code> in my databasefield it doesn't work. So I think it must be an basic error with the pathnames.</p>
  
  <p>EDIT 2:
  I tried like suggested:</p>
  
  <pre><code>$pfad = $logen-&gt;logo ;  //".".
  $baseUrl = $this-&gt;view-&gt;baseUrl() ;
  $pfad=$baseUrl.$pfad;
  </code></pre>
  
  <p>I get the same error message like before. I tried to get the baseUrl which is:</p>
  
  <pre><code>/cheyenne/public
  </code></pre>
  
  <p>That seems to be ok, so I concatenated the rest of my path, and I get for the first record:</p>
  
  <pre><code>/cheyenne/public/images/logos/Berlin_1.png
  </code></pre>
  
  <p>Should be also ok, but it doesn't work. Additional I want to say that my project path on the productionsystem is in the first step under the root, should be also ok I think.</p>
  
  <p>EDIT 3:</p>
  
  <p>I tried the suggested application path, I get a wrong answer:</p>
  
  <pre><code>/mnt/weba/b3/45/5543245/htdocs/cheyenne/application/public
  </code></pre>
  
  <p>It should have been:</p>
  
  <pre><code>  /mnt/weba/b3/45/5543245/htdocs/cheyenne/public
  </code></pre>
  
  <p>To get a result which works, I tried to add this path absolute like this:</p>
  
  <pre><code>$public_path='/mnt/weba/b3/45/5543245/htdocs/cheyenne/public';
  $pfad = $public_path . $logen-&gt;logo ; 
  </code></pre>
  
  <p>I get this one:</p>
  
  <pre><code>/mnt/weba/b3/45/5543245/htdocs/cheyenne/public/images/logos/Berlin_1.png
  </code></pre>
  
  <p>which should be right, but with the image statements I get the same error like before.</p>