NetTalk Central

Author Topic: Issues displaying NetTalk camera images in a Windows application.  (Read 317 times)

jari@softmade.fi

  • Full Member
  • ***
  • Posts: 133
    • View Profile
    • Email
I?m having trouble getting images taken with the NetTalk (image is saved to the BLOB) camera to display in my Windows application.
But if I load a file into the BLOB, everything works fine both on the web and in the Windows application .
However, images taken with the camera are visible on the web, but not in the Windows application.

Any ideas?

rjolda

  • Sr. Member
  • ****
  • Posts: 325
    • View Profile
    • Email
Re: Issues displaying NetTalk camera images in a Windows application.
« Reply #1 on: November 11, 2024, 03:11:26 AM »
HI, NT stores the pictures in the images folder under the web folder as PMG files.  NT apps should be able to save to BLOB and to the images folder. Can you access the png images in the images folder.  You should be able to view these images on your NT server with any program which will open a graphic.  If you can do this, try your windows APP. It should be able to open this as well.
I am not sure what you are really trying to say about your image in a BLOB and your windows application.  However, Web applications can open images delivered from blobs almost natively.  That does NOT exist in desktop applications.  On desktop, try using BlobToFile in String theory and save it to disk and use that image file in your web app.  You can delete the image file when procedure is done.
Maybe this will get you started.
Ron 

jari@softmade.fi

  • Full Member
  • ***
  • Posts: 133
    • View Profile
    • Email
Re: Issues displaying NetTalk camera images in a Windows application.
« Reply #2 on: November 11, 2024, 04:30:43 AM »
Hi Ron

I created a test program that demonstrates the issue. Copy it to the Webcam (79) folder.

Jari

JohanR

  • Sr. Member
  • ****
  • Posts: 374
    • View Profile
    • Email
Re: Issues displaying NetTalk camera images in a Windows application.
« Reply #3 on: November 11, 2024, 07:34:24 AM »
Hi Jari

I would try to save the image to disk to validate it and debug that way

I did have a quick look, but got a compile error when I tried to add the blobtoimage function

Will have a look later when I have more time

Johan

 

JohanR

  • Sr. Member
  • ****
  • Posts: 374
    • View Profile
    • Email
Re: Issues displaying NetTalk camera images in a Windows application.
« Reply #4 on: November 11, 2024, 09:12:45 PM »
Hi Jari

From the BLOB help
If you need to save images to a BLOB, and later restore them to an output file, the type of image should also be saved in the database (JPG, GIF, BMP, etc.).
Using BLOBTOFILE to save to a different extension can produce unpredictable results.

Possible problem is that the original file is PNG, and when the Blob is saved to disk it's a base64 encoded png file.
so you probably need to do some decoding and converting the image to different format.


regards

Johan


Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11247
    • View Profile
Re: Issues displaying NetTalk camera images in a Windows application.
« Reply #5 on: November 11, 2024, 10:37:41 PM »
have you looked inside the blob record to see what is actually there? is it binary, or base64 encoded?

JohanR

  • Sr. Member
  • ****
  • Posts: 374
    • View Profile
    • Email
Re: Issues displaying NetTalk camera images in a Windows application.
« Reply #6 on: November 11, 2024, 11:34:45 PM »
Hi Bruce

Yes,

below first few chars from the file that was saved with this code in the desktop program.

data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAoAAAAHgCAYAAAA10dzkAAAAAX

Code in desktop program
loc:filename = 'c:\tmp\' & random(11111,99999) & '.jpg'
IF BLOBTOFILE(ALI:Photo,loc:filename)  !returns an ERRORCODE if copy fails
   MESSAGE('BLOB did not copy due to the following ERRORCODE: ' & ERRORCODE())
else
   tmp_st.loadfile(loc:filename)
   message('saved:') 
END
Copying that to decoding website produces an image file.

Think it needs a few more lines of code to sort it out to display on screen

regards

Johan





I

JohanR

  • Sr. Member
  • ****
  • Posts: 374
    • View Profile
    • Email
Re: Issues displaying NetTalk camera images in a Windows application.
« Reply #7 on: November 11, 2024, 11:38:07 PM »
Hi Bruce

Sorry ,
The loading of the file into a ST object was to try the ST decode,
but I had some issues with saving the file into usbale format.
will check again later and and try to figure out why

Johan