Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

How do I insert a bitmap in a file ?

( #48719=categorized question: print w/ replies, xml ) Need Help??
Contributed by Anonymous Monk on Dec 29, 2000 at 03:24 UTC
Q&A  > files


Description:

Hello, I've to insert a signature into a ASCII document. This signature can be a .bmp or something else. I use PERL on a Unix plateform (AIX). Thank you for any advices. Marcel Fleury

Answer: How do I insert a bitmap in a file ?
contributed by bikeNomad

An ASCII document can't contain an image, since then it wouldn't be ASCII any more. Perhaps I'm missing something.

If you just want to sign an ASCII document (i.e. you don't have to have an image of a written signature, but you do want to authenticate the signer and validate the integrity of the message), you should look into Crypt::DSA::Signature or a similar crypto based signature mechanism, which can attach signatures that are themselves ASCII text.

Answer: How do I insert a bitmap in a file ?
contributed by igoryonya

Just convert it to hex byte-by-byte and apply it to a scalar variable or do a UUENCODE. Listed are just 2 ways, but the possibilities are endless.

Please (register and) log in if you wish to add an answer



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others having an uproarious good time at the Monastery: (6)
    As of 2014-10-01 09:41 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      How do you remember the number of days in each month?











      Results (392 votes), past polls