# Load image file which is changed the filename extension

**URL:** <https://forum.commonvisionblox.com/t/load-image-file-which-is-changed-the-filename-extension/1040>\
**Category:** Programming Questions\
**Tags:** csharp\
**Created:** [February 4, 2020, 3:19am UTC](https://forum.commonvisionblox.com/t/load-image-file-which-is-changed-the-filename-extension/1040 "2020-02-04T03:19:25Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![MartinK](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.commonvisionblox.com/martink/32/74_2.png) [@MartinK](https://forum.commonvisionblox.com/u/MartinK)\
**Post date:** [February 4, 2020, 2:33pm UTC](https://forum.commonvisionblox.com/t/load-image-file-which-is-changed-the-filename-extension/1040/3 "2020-02-04T14:33:00Z")

</div>

Hi @Jesse,

can it bee that your sample program is targetting 64bit Windows but the Visual Studio configuration setting is _AnyCPU_ and the _Prefer32Bit_ option is checked? In that case you will get all the problems mentioned in several articles here regarding a mix of 32bit and 64bit runtimes such as [here](https://forum.commonvisionblox.com/t/cant-use-ocx-components-on-x64-failed-to-create-axhost/487/2) or [here](https://forum.commonvisionblox.com/t/hello-world-cvb/249/2).

This code here works fine having a _x64_ configuration or having the _Prefer32Bit_ option disabled:

```cs
private void Form1_Load(object sender, EventArgs e)
        {
            try
            {
                string ext = "bmp";
                using (var image = Stemmer.Cvb.Image.FromFile("C:\\cvb\\tutorial\\clara." + ext))
                {
                    Console.WriteLine("Writing *." + ext);
                    image.Save("C:\\cvb\\Myclara." + ext);
                    ext = "png";
                    Console.WriteLine("Writing *." + ext);
                    image.Save("C:\\cvb\\Myclara." + ext);
                    ext = "tif";
                    Console.WriteLine("Writing *." + ext);
                    image.Save("C:\\cvb\\Myclara." + ext);
                    ext = "jpeg";
                    Console.WriteLine("Writing *." + ext);
                    image.Save("C:\\cvb\\Myclara." + ext);
                    ext = "jpg";
                    Console.WriteLine("Writing *." + ext);
                    image.Save("C:\\cvb\\Myclara." + ext);
                }
                Console.WriteLine("Finished");
            }
            catch (IOException ex)
            {
                Console.WriteLine(ex);
            }
        }

```

In more detail: Bitmaps and TIFs (and all of its high-bit versions) are written by the _CVCImg.DLL_. Other formats such as PNG, TGA, JPEG, JPEG2000 etc. are implemented in the _CVCFile.DLL_ which makes use of OpenSource libraries. The loading of the _CVCFile.DLL_ fails in case of the 32/64 bit mismatch.

kind regards,  
Martin

---

_[View the full topic](https://forum.commonvisionblox.com/t/load-image-file-which-is-changed-the-filename-extension/1040)._
