Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Closed Thread
 
Thread Tools Display Modes
  #11  
Old 08-07-2019, 03:18 PM
FreakaZoid2 FreakaZoid2 is offline
Senior Member
 
Join Date: Jul 2009
Posts: 361
Default

the 0x47.... data is stored in a database as varbinary.
is that what is making the string behave like a blob and not a real string of data?
if so how would I go about turning that string back into binary data to load up into a string?
  #12  
Old 08-07-2019, 06:54 PM
FreakaZoid2 FreakaZoid2 is offline
Senior Member
 
Join Date: Jul 2009
Posts: 361
Default i have dug deeper and discovered that the

varbinabry always shows 0x47....
but the underlying string of data is actually different.
R0lGODlhSwFnAPcAAAAAAAAAMwAAZgAAmQ.....(base64)

lots of confusion on this issue.
basically we have 2 different development teams (C# which accesses the data directly, cobol which we have to get from a .NET interface that sends back data in an quasi xml format) I asked for the data that was being sent to the cobol program (i don't have it all setup to work directly) so i asked the C# dev to send me a sample of the raw data that they get. they sent the 0x47... string but that is not the real data that is in the varbinary.
i will now go thru all the setup to get the credit card payment processor all setup and working so i can see the real data being sent to it. hopefully it won't be the 0x47 but the actual base64 string.
  #13  
Old 08-08-2019, 08:31 AM
Norrit Norrit is offline
Moderator
 
Join Date: Aug 2001
Location: Landgraaf
Posts: 7,333
Default

If it's possible to post a complete string of what you're receiving an try to translate it would be easier, then we could do some tests aswell.
Do they have an anonymous/test file that they can output?
  #14  
Old 08-08-2019, 02:27 PM
FreakaZoid2 FreakaZoid2 is offline
Senior Member
 
Join Date: Jul 2009
Posts: 361
Default this is what i was given that is supposed to actually be in the

varbinary field.
Quote:
R0lGODlhSwFnAPcAAAAAAAAAMwAAZgAAmQAAzAAA/wAzAAAzMwAzZgAzmQAzzAAz/wBmAABmMwBmZgBmmQBmzABm/wCZAACZMwCZZgCZmQCZzACZ/wDMAADMMwDMZgDMmQDMzADM/wD/AAD/MwD/ZgD/mQD/zAD//zMAADMAMzMAZjMAmTMAzDMA/zMzADMzMzMzZjMzmTMzzDMz/zNmADNmMzNmZ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/j61T/X/SyDuIsgAf3OppHMVQxuq3sP25KVt/JJK3wI65gITyi44wTvLfJpoWcu+BIa1tBrnJPgvTLYwK4VTmq0 Y9sT6eQg5Ryvb1OMotR4pjse3i50QdTUFfXDI8aJDoq0E5/zBujEgInxg1fBIMWm1rnFlbCJ+JPiGzUWRw/mEHvBUt3/LLdHK/axRjfcGAA/xsRCImVJehQfB9XXQxs68pGHFA3ymnjHSyalR5FkieYGF0pPIl B4YCkgr0ppyr/BTi4+o1orB0NJTclylmBa5JkMiEudQKyQkOuIpeQsBcw2CpOWx Nyj/I5JuuQp05LMzGXrxDjKaPryiMWEpjXVVDVPpm6bDHJfL6sJTkM q8pjkLOdnWDjORqrznajpJDznCR5W0vOe2MSnPvfJz376858AD ahAB0rQghr0oAhNqEIXytCGOvShEI2oRCdK0Ypa9KIYzahGN8r Rjnr0oyAN6ZkCAgA7
  #15  
Old 08-08-2019, 02:32 PM
FreakaZoid2 FreakaZoid2 is offline
Senior Member
 
Join Date: Jul 2009
Posts: 361
Default

in the background of all this, with 99% certainty, the signature comes to us as Base64 (presumed to be a bitmap) then the .NET app (buffer dll for giving me access to .NET components from COBOL) they issue the
convert.base64string and that is what I am supposed to be getting.
  #16  
Old 08-08-2019, 02:38 PM
FreakaZoid2 FreakaZoid2 is offline
Senior Member
 
Join Date: Jul 2009
Posts: 361
Default

bitmap -> base64 -> string
  #17  
Old 08-13-2019, 07:04 PM
FreakaZoid2 FreakaZoid2 is offline
Senior Member
 
Join Date: Jul 2009
Posts: 361
Default interesting thing....

using...
Code:
var
  astr: string;
  bytes : TBytes;
begin
  bytes := TNetEncoding.Base64.DecodeStringToBytes(mmo2.Lines.Text);
  astr := TEncoding.ASCII.GetString(bytes);
Then saving the astr to a file (filestream) I can then open the file as a graphic (GIF for sure) not sure how to load that GIF string into a graphic image and save it as a bitmap file. (Yet...)
  #18  
Old 08-13-2019, 07:45 PM
FreakaZoid2 FreakaZoid2 is offline
Senior Member
 
Join Date: Jul 2009
Posts: 361
Default this is the converted bytes

but I can't load it into an image not even a WICImage without getting an error. (different signature than the original one posted) Do I need to remove the beginning bytes or something. Not a graphics guru sorry....

Code:
'GIF89aK'#1'g'#0'w'#0#0#0#0#0#0#0'3'#0#0'f'#0#0#$19#0#0'L'#0#0#$7F#0'3'#0#0'33'#0'3f'#0'3'#$19#0'3L'#0'3'#$7F#0'f'#0#0'f3'#0'ff'#0'f'#$19#0'fL'#0'f'#$7F#0#$19#0#0#$19'3'#0#$19'f'#0#$19#$19#0#$19'L'#0#$19#$7F#0'L'#0#0'L3'#0'Lf'#0'L'#$19#0'LL'#0'L'#$7F#0#$7F#0#0#$7F'3'#0#$7F'f'#0#$7F#$19#0#$7F'L'#0#$7F#$7F'3'#0#0'3'#0'33'#0'f3'#0#$19'3'#0'L3'#0#$7F'33'#0'33333f33'#$19'33L33'#$7F'3f'#0'3f33ff3f'#$19'3fL3f'#$7F'3'#$19#0'3'#$19'33'#$19'f3'#$19#$19'3'#$19'L3'#$19#$7F'3L'#0'3L33Lf3L'#$19'3LL3L'#$7F'3'#$7F#0'3'#$7F'33'#$7F'f3'#$7F#$19'3'#$7F'L3'#$7F#$7F'f'#0#0'f'#0'3f'#0'ff'#0#$19'f'#0'Lf'#0#$7F'f3'#0'f33f3ff3'#$19'f3Lf3'#$7F'ff'#0'ff3fffff'#$19'ffLff'#$7F'f'#$19#0'f'#$19'3f'#$19'ff'#$19#$19'f'#$19'Lf'#$19#$7F'fL'#0'fL3fLffL'#$19'fLLfL'#$7F'f'#$7F#0'f'#$7F'3f'#$7F'ff'#$7F#$19'f'#$7F'Lf'#$7F#$7F#$19#0#0#$19#0'3'#$19#0'f'#$19#0#$19#$19#0'L'#$19#0#$7F#$19'3'#0#$19'33'#$19'3f'#$19'3'#$19#$19'3L'#$19'3'#$7F#$19'f'#0#$19'f3'#$19'ff'#$19'f'#$19#$19'fL'#$19'f'#$7F#$19#$19#0#$19#$19'3'#$19#$19'f'#$19#$19#$19#$19#$19'L'#$19#$19#$7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+P'#2#$B'i9TBEn2~-*'#$1C'?y}'#$18'm3~N{n}'#$1E#$B#$B'3'#$E'o1'#$F'~[(P'#$13'O\9!X#'#$B'W%'#$1E#$17'W7.'#$1C'F=9_'#$11'7I7"q'#$F'v'#$18'h#g6ik'#8'Gx-=ib=^)Z'#$E'Lqn(>Nx8{B'#8'#Z+'#7'CIMIr'#$16'`Zd'#$19#$C#8'K'#$1D'@,'#$10#$10'k'#8'%d,'#5'L6'#$A#$13#$16'D\#|'#$E'I:d)S'#$12'LLekD8Jhzr'#8'E'#4'&5UT5O&n'#$1B#$C'r_/+'#9'NC*r'#$18'd,ggX8NF*s'#$1D'(i$wIO~zs'#$1F#0#$D'(@'#7'JP'#2#$1A't '#8'M(B'#$17'JP'#6':t!'#$10#$D'(D''JQ'#$A'Zt"'#$18'M(F7JQ'#$E'zt# '#$D'i'#$19#2#2#0';'
  #19  
Old 08-14-2019, 04:12 PM
FreakaZoid2 FreakaZoid2 is offline
Senior Member
 
Join Date: Jul 2009
Posts: 361
Default More info

if I save the string to a file, then load that up into a twicimage it works. but it will not let me load the string into the wicimage.
I compared the string value to the file and they are nothing alike. apparently saving it to a file changes the string into a valid image. any ideas of what I need to do the string in order to load it into the image?
  #20  
Old 08-14-2019, 04:33 PM
FreakaZoid2 FreakaZoid2 is offline
Senior Member
 
Join Date: Jul 2009
Posts: 361
Default Thanks for the help and guidance

I really do appreciate as it keeps me plugin along....
Here was the solution.
Code:
procedure TForm1.btn1Click(Sender: TObject);
var
  wic : TWICImage;
  _bs : TBytesStream;
begin
  wic := TWICImage.Create;
  _bs := TBytesStream.Create(TNetEncoding.Base64.DecodeStringToBytes(mmo2.Lines.Text));
  _bs.Position := 0;
  wic.LoadFromStream(_bs);
..
Again thank you all so much for the guidance and help.
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT. The time now is 11:49 AM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.