LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 11-19-2012, 01:15 PM   #16
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282

So, have you tried the file command on your dat file (the one that contains binary data)?
 
1 members found this post helpful.
Old 11-19-2012, 02:59 PM   #17
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: Austin, TX
Distribution: Mint-15 with Cinnamon & KDE
Posts: 1,361
Blog Entries: 3

Original Poster
Rep: Reputation: 86
Quote:
Originally Posted by Wim Sturkenboom View Post
So, have you tried the file command on your dat file (the one that contains binary data)?
BLUSH

Not yet! I'm still "researching" while I
  1. recover from knee surgery
  2. be "grand-pa" to new grand baby

The beauty of the *nix world is that your can learn about so much.
The tragedy of the *nix world is that there is so much you can learn. (grin)

Thanks for the nudge,
~~~ 0;-Dan
 
Old 11-19-2012, 05:51 PM   #18
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: Austin, TX
Distribution: Mint-15 with Cinnamon & KDE
Posts: 1,361
Blog Entries: 3

Original Poster
Rep: Reputation: 86
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the Process to install Reliance Netconnect+ ZTE Data card in RHEL6.0 32-bit vvn1985 Red Hat 7 10-18-2012 11:07 AM
How to use BSNL Data Card(Mobi Data 0x1c9e:0xf000) in Fedora 13 jitenderpal Linux - Newbie 1 11-18-2010 10:38 PM
How to send data to WAN Interface card at Data link Layer in linux environment krishna_karne Linux - Software 0 05-09-2008 04:01 AM
Processing data from a 'foreign' database with mysql, or tools to pre-process data. linker3000 Linux - Software 1 08-14-2007 08:36 PM
Switching distros and wanting to keep data RoughEdge Linux - Newbie 11 07-07-2007 01:50 PM


All times are GMT -5. The time now is 01:02 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration