More on graphic storage / evaluation

More on graphic storage / evaluation

Postby TimStone » Tue Oct 13, 2015 11:33 pm

Last week I was working with a JPG file, and managed to store it in a memo field. It was a signature captured by a credit card terminal.

Now I have a different service provider, and they return a string (Base64 encoded ) which is supposedly in .jpg format:

Code: Select all  Expand view
SUkqAHYBAACAP+BQOCQWDQeEQmFQuGQ2HQ+IRGJROKRWLReMRmNRuOR2PR+QSGRSOSSWTR93xkHxh8N+MIcfxg/RhwP6MB9+w8ATsPwR4P9xw5gQNzwRnv+XQxATGBPuBviY0mFAA/wR7wNDwKmQl8Qajv9+VV+Qt/AeDUx502FsGDTaBSl/1eEv6twO2QKk3KEOG2gCzP+mV+EJ+DUOnW5/r+FVWCXR/06cwLGQexwWhv+c5F/ZODU6BPwHvie4/MQLIwjPP4B2mB1fI6eD5586WB3C1Ql+D9+WbEP/BaR/uCC4p/sABwPJ4SB054B/Ocrh8iCPgwSviQrib2BcrrwniZWD92F6yD3WF7aDVVAZyEJ6ETZ8eyDv4A++4wx8VSETmVwqyqKhB8p+hb6qkgx5v6hLhMA3CyJ7AaKLu36JKY8yILcrqKtmf8AIoop/NGiiUr4iyUwMk8URTFUVxZFsXRfGEYxlGcaRrG0bxxHMdR2jaAgOAP4ABAABAAAAAAAAAAABBAABAAAA0AAAAAEBBAABAAAAcAAAAAIBAwABAAAAAQAAAAMBAwABAAAABQAAAAYBAwABAAAAAQAAABEBBAABAAAACAAAABUBAwABAAAAAQAAABYBBAABAAAAcAAAABcBBAABAAAAbgEAABoBBQABAAAAJAIAABsBBQABAAAALAIAACgBAwABAAAAAgAAAD0BAwABAAAAAQAAAAAAAAAAdwEA6AMAAAB3AQDoAwAA
 


The code section is the value they provide me. So, I need to convert the Base64 encoded string and save it as a .jpg which I can then read into my memo file. Once I have it in .jpg format, the rest is already done.

My other vendor provided a simple call that converted their string and saved it as a .jpg. In this case, I need to do it using harbour/xharbour functions.

Your thoughts would be appreciated.
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2909
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: More on graphic storage / evaluation

Postby Gale FORd » Wed Oct 14, 2015 1:28 am

memowrit( 'image.jpg', hb_base64Decode( cData ) )
Gale FORd
 
Posts: 663
Joined: Mon Dec 05, 2005 11:22 pm
Location: Houston

Re: More on graphic storage / evaluation

Postby TimStone » Wed Oct 14, 2015 4:46 pm

Thank you Gale. I am now 100% with this working.

I wonder how many people are actually integrating credit cards into the system.

I believe you indicated you are using a tablet signature system ? Does it simply show a line on which to sign, or does it actually show the signature on the screen as it is being performed ?

I looked at signature pads, but they appeared to be quite expensive.

Tim
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2909
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: More on graphic storage / evaluation

Postby Gale FORd » Wed Oct 14, 2015 5:09 pm

I am doing it on the screen and they can use finger or pen. I started with signatur.prg in the samples folder.
There were some issues (not major) but I modified it and it is working pretty good.
I started out by just saving the signature in memo field but later found that it worked better for our imaging system if I saved the whole receipt as image and then import into imaging system.
I modified the print/preview system so that it uses part of the meta file creation of print preview and converts the meta file to jpg images so I can import them into the imaging system.
It now prints receipt and saves the image at the same time.
Gale FORd
 
Posts: 663
Joined: Mon Dec 05, 2005 11:22 pm
Location: Houston

Re: More on graphic storage / evaluation

Postby TimStone » Wed Oct 14, 2015 5:56 pm

Very nice. I'm thinking I may add a linked file just for the signatures since I don't want to risk problems with the main order file.

Where did you run into problems ?

Tim
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2909
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: More on graphic storage / evaluation

Postby Gale FORd » Thu Oct 15, 2015 12:55 pm

The inking would get confused sometimes. If you moved outside signature area with button down it would not recover well. If you want my updates let me knw.
Gale FORd
 
Posts: 663
Joined: Mon Dec 05, 2005 11:22 pm
Location: Houston

Re: More on graphic storage / evaluation

Postby TimStone » Thu Oct 15, 2015 9:07 pm

I'd love to see your updates, and work with it.

Email is tim at gtstone dot com

Tim
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2909
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: MarcoBoschi and 41 guests