Tried the following:
Code:
prompt$ base64 <file1.png >file1.b64
prompt$ base64 --decode <file1.b64 >file1.dat
prompt$ file file1.dat
file1.dat: PNG image data, 227 x 171, 8-bit/color RGB, non-interlaced
I also tried:
Code:
prompt$ base64 <file1.jpg >file1.b64
prompt$ base64 --decode <file1.b64 >file1.dat
prompt$ file file1.dat
file1.dat: JPEG image data, JFIF standard 1.01
Clearly, there are bits in the decoded data that will inform 'file' about the
format of the original image.
So my utility needs to
- extract the base64 blob
- decode the base64 blob to a bit file
- run the 'file' command against the bit file
- grab the output of 'file' to learn the format
- rename the bit file with the proper file type value
Whistling "Dixie" in the graveyard.
Thanks to all,
~~~ 0;-Dan