Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^3: encode/decode images

by Joost (Canon)
on Feb 25, 2009 at 22:25 UTC ( [id://746393]=note: print w/replies, xml ) Need Help??


in reply to Re^2: encode/decode images
in thread encode/decode images

JPEG images ARE just binary streams. You can encode them to various ASCII/text type encodings, but all of those will increase the size of the resulting string/stream/file. You could transform the image to some pure-text image format, like XPM, but for typical JPEGs that will increase the size a lot more than a simple base64-type encoding of the original JPEG data.

Bottom line: use "raw" binary strings when dealing with inherently binary data, unless you really need some encoding (for instance, when mailing the data or encapsulating it in an XML file).

update: Postgres does have facilities for dealing with binary data directly. So read the docs for the right module.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://746393]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2024-04-24 09:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found