A quick and simple example of this:
Note that I'm commented out the line which appends the data to the image in the code above. This is because I've already appended it to the image here, so all I have to do is GetData back from the image, to showcase it working for us.
And if you open that file up in any text editor, you'll see a bunch of jibberish like the following:
I deleted a bunch of this image data as it's irrelevant to any text editor. The main thing here to pay attention to is what's at the END of that file... Plain text, which can be easily read by anyone who wants to open it up and look at it. No decoding or ninja skills required.
Code: (Select All)
CHDIR "z:"
photo$ = "steve.png"
'AppendData photo$, "This is Steve, back before he graduated from high school."
text$ = GetData(photo$)
SCREEN _NEWIMAGE(480, 640, 32)
image = _LOADIMAGE(photo$)
_PUTIMAGE (0, 0)-(480, 600), image
_PRINTSTRING (0, 610), text$
SLEEP
SUB AppendData (image$, text$)
DIM AS LONG f, l
f = FREEFILE
PRINT image$, _FILEEXISTS(image$)
OPEN image$ FOR BINARY AS #f
PUT #f, LOF(f) + 1, text$
l = LEN(text$)
PUT #f, , l
CLOSE #f
END SUB
FUNCTION GetData$ (image$)
DIM AS LONG l, f, l2
f = FREEFILE
OPEN image$ FOR BINARY AS f
l = LOF(f)
GET #f, l - 3, l2
text$ = SPACE$(l2)
GET #f, l - 3 - l2, text$
CLOSE #f
GetData$ = text$
END FUNCTION
Note that I'm commented out the line which appends the data to the image in the code above. This is because I've already appended it to the image here, so all I have to do is GetData back from the image, to showcase it working for us.
And if you open that file up in any text editor, you'll see a bunch of jibberish like the following:
Quote:...stuff before this...
ӁϾ _ ` ݻ> 7 s = B~ o _ 5A @Ϩ ' N>ȧ 7 :{ ! X ? !م 1b3:^ џ
3 Q&D; "< h ^ - r /}i= ?hC Ա @ɞ ~<l\ K..c | K 4 Y
i0h W\ ܹ } Mwv U 7 p > 9mC0 + ={ L^ '& #cN8C g ֭ f, c lx[; a h $: ti-> } *]
7 8 ӷ ߄yy֬' f _'9c}` ﮷ o t K 3 oyq ֤vmx 2Q Y _r v i 1; :
H ڳļ }Reҙ `ͭ }+ \' |W = y f{6e S pn㫭 : { ʵ [r
oő) ̇ ^e ? ߧm rS `\ Kd G<
>u X x [ o-' ^ Ե ᜕ ^%` l4 @ 4 Ar` r% tV Ӯ K2G W 뿴 K G Ŵ ; g J;H Y0 f 8 o '> v ٸ d h ۉ 1 䛿
. W=9X3 R Wd A c
H\x [ { 0 C< W~ $z m u ~ K_ , gz
i w` S+ " q n (^ 5 3 w 7WG6 J| ?8 wOo y ׃ 3o?xp w s Og ǿu{v y ־Ÿ}{~q dۛ ~
˕ cr \ - | ux y Zw z־ d K 6] \ n 2 k 9 { z A = X > p 8 >_ %ѦC[ \u d z / `^ ը- | : :>yv + RrO eXIfMM * S IEND B` This is Steve, back before he graduated from high school.9
I deleted a bunch of this image data as it's irrelevant to any text editor. The main thing here to pay attention to is what's at the END of that file... Plain text, which can be easily read by anyone who wants to open it up and look at it. No decoding or ninja skills required.