On 3/28/2013 5:29 AM PT, Jim Taylor typed:

First off verify that it is actually an inline jpg and remove everything
before the beginning of the jpg.  The inline jpg begins with hex ff d8
ff e0 which when base64 encoded is hex 2f 39 6a 2f.

C:\toolsjim>dump encoded.txt | head -3
encoded.txt:
00000000  2f39 6a2f 3441 4151 536b 5a4a 5267 4142 /9j/4AAQSkZJRgAB
00000010  4151 4541 7441 4330 4141 442f 3454 7732 AQEAtAC0AAD/4Tw2

I don't know where to get dump and head commands for my very old, updated Windows XP Pro. SP3 machine. However, I can see the texts in mine that I left in for the decoding in its beginning:

9j/4S32RXhpZgAATU0AKgAAAAgACwEPAAIAAAAGAAAAkgEQAAIAAAAKAAAAmAESAAMAAAABAAEA
AAEaAAUAAAABAAAAogEbAAUAAAABAAAAqgEoAAMAAAABAAIAAAExAAIAAAAGAAAAsgEyAAIAAAAU
AAAAuAITAAMAAAABAAEAAIdpAAQAAAABAAAAzIglAAQAAAABAAACUgAAAxxBcHBsZQBpUGhvbmUg
NFMAAAAASAAAAAEAAABIAAAAATYuMS4yADIwMTM6MDM6MjQgMjA6MzQ6MzgAABiCmgAFAAAAAQAA
AfKCnQAFAAAAAQAAAfqIIgADAAAAAQACAACIJwADAAAAAQKAAACQAAAHAAAABDAyMjGQAwACAAAA...


C:\toolsjim>dump decoded.jpg | head -3
decoded.jpg:
00000000  ffd8 ffe0 0010 4a46 4946 0001 0101 00b4 .X.`..JFIF.....4
00000010  00b4 0000 ffe1 3c36 4578 6966 0000 4d4d .4...a<6Exif..MM

I can't even decode yet. :P


If it looks like a valid jpg try using the ignore error switch of your
base64 decoder.  Also realize that if you don't supply an "outfile" to
the command it decodes to the screen.

base64 -di infile.txt outfile.jpg

$ base64 -di encoded.txt decoded.jpg
base64: extra operand `encoded.txt'
Try `base64 --help' for more information.

$ base64 --help
Usage: base64 [OPTION]... [FILE]
Base64 encode or decode FILE, or standard input, to standard output.

  -d, --decode          decode data
  -i, --ignore-garbage  when decoding, ignore non-alphabet characters
-w, --wrap=COLS wrap encoded lines after COLS character (default 76).
                          Use 0 to disable line wrapping

      --help     display this help and exit
      --version  output version information and exit

With no FILE, or when FILE is -, read standard input.

The data are encoded as described for the base64 alphabet in RFC 3548.
When decoding, the input may contain newlines in addition to the bytes of
the formal base64 alphabet.  Use --ignore-garbage to attempt to recover
from any other non-alphabet bytes in the encoded stream.

Report base64 bugs to bug-coreut...@gnu.org
GNU coreutils home page: <http://www.gnu.org/software/coreutils/>
General help using GNU software: <http://www.gnu.org/gethelp/>
For complete documentation, run: info coreutils 'base64 invocation'

$ base64 --v
base64 (GNU coreutils) 8.5
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Simon Josefsson.
--
"She's got ants in her pants." --unknown
   /\___/\         Ant(Dude) @ http://antfarm.ma.cx (Personal Web Site)
  / /\ /\ \                Ant's Quality Foraged Links: http://aqfl.net
 | |o   o| |
    \ _ /        If crediting, then use Ant nickname and AQFL URL/link.
     ( )         If e-mailing, then axe ANT from its address if needed.
Ant is currently not listening to any songs on this computer.
_______________________________________________
support-seamonkey mailing list
support-seamonkey@lists.mozilla.org
https://lists.mozilla.org/listinfo/support-seamonkey

Reply via email to