folder creation problem during thumbnail generation c#
<p>I am generating Thumbnails, Everything goes fine and smooth but there is a problem during the creation of sub folder. Suppose:</p>

<p><strong>C:\Users\a\Desktop\b test\Iceland\Haskolinn2</strong>
the destination thumbnail folder will look like this:
<strong>C:\Users\a\Desktop\a test\Iceland</strong>
*<em>C:\Users\a\Desktop\a test\Haskolinn2</em>*</p>

<p>it must look like 
<strong>C:\Users\a\Desktop\a test\Iceland\Haskolinn2</strong></p>

<p>here is the code: </p>

<pre><code> public void CreateThumbnail(double wid, double hght, bool Isprint)
    {


        string saveAt = "C:\\Users\\a\\Desktop\\a test";

string b= "C:\\Users\\a\\Desktop\\b test\\iceland"         
string [] bb = Directory.GetDirectories(b, "*.*", SearchOption.AllDirectories);

       foreach (string path in bb)
      {
            var directory = new DirectoryInfo(path);

            string outputPath = Path.Combine(saveAt, directory.Name);
            foreach (FileInfo f in directory.GetFiles("*.*", SearchOption.AllDirectories))
            {



                if (f.DirectoryName != directory.FullName)
                {
                    outputPath = Path.Combine(saveAt, directory.Name);

                }
                if (!Directory.Exists(outputPath))
                {
                    Directory.CreateDirectory(outputPath);

                }


                using (Image imagesize = Image.FromFile(f.FullName))

                using (Bitmap bitmapNew = new Bitmap(imagesize))
                {
                    double maxWidth = wid;
                    double maxHeight = hght;
                    int w = imagesize.Width;

                    int h = imagesize.Height;
                    // Longest and shortest dimension 
                    int longestDimension = (w &gt; h) ? w : h;

                    int shortestDimension = (w &lt; h) ? w : h;
                    // propotionality  
                    float factor = ((float)longestDimension) / shortestDimension;

                    // default width is greater than height    
                    double newWidth = maxWidth;
                    double newHeight = maxWidth / factor;

                    // if height greater than width recalculate  
                    if (w &lt; h)
                    {
                        newWidth = maxHeight / factor;

                        newHeight = maxHeight;
                    }

                    string fileName = Path.Combine(outputPath, Path.GetFileNameWithoutExtension(f.Name) + ".jpeg");

                    bitmapNew.GetThumbnailImage((int)newWidth, (int)newHeight, () =&gt; false, IntPtr.Zero)

                        .Save(fileName, System.Drawing.Imaging.ImageFormat.Jpeg);



                }

            }
        }
    }


}
</code></pre>
