Results 1 to 5 of 5

Thread: base64 to jpeg

  1. #1
    Join Date
    Aug 2012
    Posts
    41

    Unanswered: base64 to jpeg

    Hi,

    I am wondering if someone can help / advise

    I have images stored in a database.
    Images are encoded in base64
    they are of the format .png
    Using db2 v9

    I need to convert these images to jpeg or gif
    store them in a new table or the same table with a new row

    How best can this be achieved without have to install external converters / applications ?

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Quote Originally Posted by alexandra123 View Post

    How best can this be achieved without have to install external converters / applications ?
    Well, you could implement your own internal converters as database routines.
    ---
    "It does not work" is not a valid problem statement.

  3. #3
    Join Date
    Jul 2013
    Location
    Moscow, Russia
    Posts
    666
    Provided Answers: 55
    Hi,

    probably the simplest way is do download a jar file like Apache Commons Codec and write a simple java function using org.apache.commons.codec.binary.Base64 class.
    Depending on your platform (Java software support for DB2 products) it can be Codec 1.5 or 1.6.
    Regards,
    Mark.

  4. #4
    Join Date
    Jan 2009
    Location
    Zoetermeer, Holland
    Posts
    746
    Quote Originally Posted by mark.b View Post
    probably the simplest way is do download a jar file like Apache Commons Codec and write a simple java function
    Do I want to know the complex way?
    Somewhere between " too small" and " too large" lies the size that is just right.
    - Scott Hayes

  5. #5
    Join Date
    Aug 2012
    Posts
    41
    thanks for the response guys,

    I ended up getting this to work in the application by wrapping the clob around html tags outside of DB2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •