# Problem with the function Cvb::Image.load("adresse image.bmp")

**URL:** <https://forum.commonvisionblox.com/t/problem-with-the-function-cvb-image-load-adresse-image-bmp/1316>\
**Category:** C++ API\
**Created:** [January 20, 2021, 1:11pm UTC](https://forum.commonvisionblox.com/t/problem-with-the-function-cvb-image-load-adresse-image-bmp/1316 "2021-01-20T13:11:22Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![enzo](https://avatars.discourse-cdn.com/v4/letter/e/3ab097/32.png) [@enzo](https://forum.commonvisionblox.com/u/enzo)\
**Post date:** [January 20, 2021, 1:11pm UTC](https://forum.commonvisionblox.com/t/problem-with-the-function-cvb-image-load-adresse-image-bmp/1316/1 "2021-01-20T13:11:22Z")

</div>

i can load a classificationPredictor but i can’t load an image ,if you know why.  
my code:  
-mon header

 ![image](https://canada1.discourse-cdn.com/flex027/uploads/commonvisionblox/original/1X/375747db6b0b4e68b55bcb5cab8b0fbda920b7f0.png)

puis dans mon main j’utilise la commande suivante :

```cpp
classeur::classeur()
{
    classeur_=Cvb::Polimago::ClassificationPredictor::Load("C:\\Users\\stagiaire1\\Desktop\\fichier de recherche bois\\defautcommun.pcc");
    type_de_defaut_="rien";
    posQualite_=0.0;
    rechercheQualite_=0.0;
    chercheur_=Cvb::Polimago::SearchPredictor::Load("C:\\Users\\stagiaire1\\Desktop\\fichier de recherche bois\\defautcommun.psc");
    image_=Cvb::Image::Load("C:\\Users\\stagiaire1\\Desktop\\photos compressé\\exemple\\planche 17 partie 1 verso");
}

```

---

<div class="post-metadata">

**Author:** ![usernv](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.commonvisionblox.com/usernv/32/637_2.png) [@usernv](https://forum.commonvisionblox.com/u/usernv)\
**Post date:** [January 20, 2021, 1:26pm UTC](https://forum.commonvisionblox.com/t/problem-with-the-function-cvb-image-load-adresse-image-bmp/1316/2 "2021-01-20T13:26:26Z")

</div>

Hi enzo,  
from what you’ve posted, try:

- escaping backslashes
- your quotation marks seem wrong. Did you copy them from somewhere or is it just pasting in the forum?
- add the image extension

---

<div class="post-metadata">

**Author:** ![illusive](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.commonvisionblox.com/illusive/32/61_2.png) [@illusive](https://forum.commonvisionblox.com/u/illusive)\
**Post date:** [January 21, 2021, 1:12pm UTC](https://forum.commonvisionblox.com/t/problem-with-the-function-cvb-image-load-adresse-image-bmp/1316/3 "2021-01-21T13:12:49Z")

</div>

I think the quotation marks and the escaping are ok (this was just a rendering issue here because the code wasn’t actually in a code block - I’ve corrected that).

But the missing extension on the image file name is definitely a show stopper (even if the actual files does not have an extension: :cvb: determines the load to be used by looking at the file name extension).

---

<div class="post-metadata">

**Author:** ![enzo](https://avatars.discourse-cdn.com/v4/letter/e/3ab097/32.png) [@enzo](https://forum.commonvisionblox.com/u/enzo)\
**Post date:** [January 21, 2021, 1:20pm UTC](https://forum.commonvisionblox.com/t/problem-with-the-function-cvb-image-load-adresse-image-bmp/1316/4 "2021-01-21T13:20:33Z")

</div>

I try with the extension (\*.bmp) it doesn’t work i have the same problem. But thanks.

---

<div class="post-metadata">

**Author:** ![usernv](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.commonvisionblox.com/usernv/32/637_2.png) [@usernv](https://forum.commonvisionblox.com/u/usernv)\
**Post date:** [January 21, 2021, 1:45pm UTC](https://forum.commonvisionblox.com/t/problem-with-the-function-cvb-image-load-adresse-image-bmp/1316/5 "2021-01-21T13:45:21Z")

</div>

Escape the spaces as well. You should be able to load

```auto
 Cvb::ImagePtr image = Cvb::Image::Load(Cvb::InstallPath() + CVB_LIT("tutorial/ClaraRGB.bmp"));

```

---

<div class="post-metadata">

**Author:** ![enzo](https://avatars.discourse-cdn.com/v4/letter/e/3ab097/32.png) [@enzo](https://forum.commonvisionblox.com/u/enzo)\
**Post date:** [January 21, 2021, 1:53pm UTC](https://forum.commonvisionblox.com/t/problem-with-the-function-cvb-image-load-adresse-image-bmp/1316/6 "2021-01-21T13:53:12Z")

</div>

Yes it work the load work, thank you.
