title: sharp constructor won't take a variable as file path input when try to resize image - [input file missing error]
body: <p>it is quite strange that when passing a String variable to sharp() as file path input always gives me this error - </p>
  
  <p>[Error: Input file is missing or of an unsupported image format]</p>
  
  <p>I even add toString() to my variable so my return is for sure a string.      </p>
  
  <pre><code>var tmp = 'image/'+ id + '.jpg';
  var path = tmp.toString();
  
  console.log("What's in tmp: " + tmp);
  console.log("What's in path: " + path);
  
  sharp(path)
     .resize(300, 300)
     .toFile('image/'+ id + 'L.jpg', function(err, info) {
        if (err) {
          console.log('Error Type: ', err);
        }
  });
  </code></pre>
  
  <p>The way I verified my code is following:</p>
  
  <p>It works the other way so my image format is correct. I even do a 'sharp.format' to confirm its support so it's not the problem here. Next I copy the 'path' variable string from my console log output and paste it directly inside sharp constructor call = sharp().</p>
  
  <p>Console OUTPUT:</p>
  
  <p>What's in a tmp: image/1.jpg</p>
  
  <p>What's in a path: image/1.jpg</p>
  
  <pre><code>sharp('image/1.jpg')
     .resize(300, 300)
     .toFile('image/'+ id + 'L.jpg', function(err, info) {
        if (err) {
          console.log('Error Type: ', err);
        }
  });
  </code></pre>
  
  <p>Now everything starts working again - file is resized and generated in image. Switching back using 'path' variable continue gives me no luck. It surprises me with this kind of issue because it clearly stated in their document that it supports a String type input. Also now I'm confused with the difference between path and 'image/1.jpg'. Maybe my next step is to use ( path === 'image/1.jpg' ) to compare them.</p>
  
  <p>Statement from sharp doc for your reference -->
  'input (Buffer | String)? or a String containing the path to an JPEG, PNG, WebP, GIF, SVG or TIFF image file.'</p>
  
  <p>It must be something obvious I missed. I am sure that when they design the tool, they give user the flexibility to define their input path as a variable for code reuse. So any suggestion? Thanks in advance.</p>