users@jaxb.java.net

Re: Image as Base64

From: Martin Grebac <martin.grebac_at_oracle.com>
Date: Tue, 22 Mar 2011 18:25:08 +0100

Hi,
 I don't think the default is mandated by the spec to be png,
  MartiNG

On 03/22/2011 12:00 PM, Markus Karg wrote:
>
> Great, sounds exactly as what I need to have. :-)
>
>
>
> Just a last question: Is that a particular feature of Oracle's JAXB
> implementation, or will any JAXB implementation act like that?
>
>
>
> Thanks!
>
> Markus
>
>
>
> *From:*Martin Grebac [mailto:martin.grebac_at_oracle.com]
> *Sent:* Dienstag, 22. März 2011 11:59
> *To:* users_at_jaxb.java.net
> *Subject:* Re: Image as Base64
>
>
>
> PNG is the default, and yes jaxb converts by mimetype,
> MartiNG
>
> On 03/21/2011 02:47 PM, Markus Karg wrote:
>
> So if I understand correctly:
>
>
>
> * Without @XmlMimeType the transferred bytes are of what format?
> Since java.awt.Image has nothing like "getBytes", what does JAXB
> actually do to get the (originally PNG) bytes?
>
>
>
> * With @XmlMimeType the transferred bytes are converted to that
> format? So if I did ImageIO.read(PNG) with
> @XmlMimeType("image/png") JAXB will apply PNG formatting (even if
> the java.awt.Image maybe was loaded from a GIF originally)?
>
>
>
> Thanks!
>
> Markus
>
>
>
> *From:*Wolfgang Laun [mailto:wolfgang.laun_at_gmail.com]
> *Sent:* Montag, 21. März 2011 14:28
> *To:* users_at_jaxb.java.net <mailto:users_at_jaxb.java.net>
> *Subject:* Re: Image as Base64
>
>
>
> On 21 March 2011 14:13, Markus Karg <karg_at_quipsy.de
> <mailto:karg_at_quipsy.de>> wrote:
>
> Wolfgang,
>
>
>
> maybe I am blind, but where on that page does it say that
> *any* Image (possibly PNGs) will be transferred as JPGs?
>
>
> Why should a PNG be transferred as JPG? Whatever you have, as a
> byte array, is transferred. Sender and receiver should have some
> agreement; xmime:expectedContentTypes is the vehicle for that,
> resulting in a @XmlMimeType.
>
> -W
>
>
>
>
>
> Regards
>
> Markus
>
>
>
> *From:*Wolfgang Laun [mailto:wolfgang.laun_at_gmail.com
> <mailto:wolfgang.laun_at_gmail.com>]
> *Sent:* Montag, 21. März 2011 14:08
> *To:* users_at_jaxb.java.net <mailto:users_at_jaxb.java.net>
> *Subject:* Re: Image as Base64
>
>
>
> See the text (and image!) on
> http://jaxb.java.net/tutorial/section_2_2_17-Image-Data.html#Image%20Data
>
> If it has a mime type it should be representable, Java
> processing being available.
>
> -W
>
> On 21 March 2011 13:49, Markus Karg <karg_at_quipsy.de
> <mailto:karg_at_quipsy.de>> wrote:
>
> I just noticed that JAXB is able to deal with java.awt.Image.
> Looks like it uses Base64 to inline it. But I wonder what the
> transferred bytes actuall do present: The raw data of the
> BufferedImage, or a common file format like JPG, PNG, GIF.
> etc. (which one)?
>
>
>
> Thanks
>
> Markus
>
>
>
>
>
>
>
>
> --
> Martin Grebac, GlassFish/Metro/JAXB/Tooling at Oracle
> http://blogs.sun.com/mgrebac
> ICQ: 93478885

-- 
Martin Grebac, GlassFish/Metro/JAXB/Tooling at Oracle
http://blogs.sun.com/mgrebac
ICQ: 93478885