<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Converting BufferedImage Into byte[ ] or maybe even String!</title>
	<atom:link href="http://www.softwarepassion.com/converting-bufferedimage-into-byte-or-maybe-even-string/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.softwarepassion.com/converting-bufferedimage-into-byte-or-maybe-even-string/</link>
	<description>by Krzysztof Grajek</description>
	<lastBuildDate>Wed, 01 Feb 2012 20:00:39 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
	<item>
		<title>By: Anonymous</title>
		<link>http://www.softwarepassion.com/converting-bufferedimage-into-byte-or-maybe-even-string/comment-page-1/#comment-37</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Thu, 25 Sep 2008 21:12:00 +0000</pubDate>
		<guid isPermaLink="false">http://softwarepassion.com/?p=26#comment-37</guid>
		<description>&quot;The main problem with this application is the MIDP, which does its job but unfortuntelly supports only PNG format.&quot;&lt;br/&gt;&lt;br/&gt;but JPEG encoder creates JPEG image, not PNG.</description>
		<content:encoded><![CDATA[<p><!--INFOLINKS_ON-->&#8220;The main problem with this application is the MIDP, which does its job but unfortuntelly supports only PNG format.&#8221;</p>
<p>but JPEG encoder creates JPEG image, not PNG.<!--INFOLINKS_OFF--></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ooblogger</title>
		<link>http://www.softwarepassion.com/converting-bufferedimage-into-byte-or-maybe-even-string/comment-page-1/#comment-35</link>
		<dc:creator>ooblogger</dc:creator>
		<pubDate>Sat, 06 Sep 2008 17:01:00 +0000</pubDate>
		<guid isPermaLink="false">http://softwarepassion.com/?p=26#comment-35</guid>
		<description>not really sure, but as far as I remember while I was doing it, I was actually using png and jpeg encoder, and what I remember is that I loose quite a lot on quality (I think it was converted to jpeg), you would have to consult java doc to find you what is going on under the hood)</description>
		<content:encoded><![CDATA[<p><!--INFOLINKS_ON-->not really sure, but as far as I remember while I was doing it, I was actually using png and jpeg encoder, and what I remember is that I loose quite a lot on quality (I think it was converted to jpeg), you would have to consult java doc to find you what is going on under the hood)<!--INFOLINKS_OFF--></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://www.softwarepassion.com/converting-bufferedimage-into-byte-or-maybe-even-string/comment-page-1/#comment-34</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Fri, 05 Sep 2008 20:06:00 +0000</pubDate>
		<guid isPermaLink="false">http://softwarepassion.com/?p=26#comment-34</guid>
		<description>hmm i think its done after i have written the image to disk, and then reading it back from the disk by BufferedInputStream, and finally writing to xml. One thing i m confused about the swf is, i can handle jpeg image now, but what if the images are in png,gif,tiff or bmp format?</description>
		<content:encoded><![CDATA[<p><!--INFOLINKS_ON-->hmm i think its done after i have written the image to disk, and then reading it back from the disk by BufferedInputStream, and finally writing to xml. One thing i m confused about the swf is, i can handle jpeg image now, but what if the images are in png,gif,tiff or bmp format?<!--INFOLINKS_OFF--></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ooblogger</title>
		<link>http://www.softwarepassion.com/converting-bufferedimage-into-byte-or-maybe-even-string/comment-page-1/#comment-33</link>
		<dc:creator>ooblogger</dc:creator>
		<pubDate>Thu, 04 Sep 2008 12:17:00 +0000</pubDate>
		<guid isPermaLink="false">http://softwarepassion.com/?p=26#comment-33</guid>
		<description>Man, you shot me with this one, as you can see from the date of the last post on my blog I have no time for anything and unfortunatelly no time to check your code and simply don&#039;t know straight away what is happening! Why do you check the strings for equality, my purpose was to simply see the image on the mobile phone and I haven&#039;t really care what&#039;s going on under the hood more that I needed to, is the image data valid after the encoding/decoding?</description>
		<content:encoded><![CDATA[<p><!--INFOLINKS_ON-->Man, you shot me with this one, as you can see from the date of the last post on my blog I have no time for anything and unfortunatelly no time to check your code and simply don&#8217;t know straight away what is happening! Why do you check the strings for equality, my purpose was to simply see the image on the mobile phone and I haven&#8217;t really care what&#8217;s going on under the hood more that I needed to, is the image data valid after the encoding/decoding?<!--INFOLINKS_OFF--></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://www.softwarepassion.com/converting-bufferedimage-into-byte-or-maybe-even-string/comment-page-1/#comment-32</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Thu, 04 Sep 2008 12:01:00 +0000</pubDate>
		<guid isPermaLink="false">http://softwarepassion.com/?p=26#comment-32</guid>
		<description>Hi, i have problems about jpeg encoding/decoding. &lt;br/&gt;i read jpeg data from xml tree by &lt;br/&gt;&lt;b&gt;str1 = imgEl.getChild(&quot;jpegdata&quot;).getText();&lt;/b&gt;&lt;br/&gt;and then decode it by &lt;br/&gt;&lt;b&gt;imgBytes = Base64.decode(str1);&lt;/b&gt;&lt;br/&gt;then i truncate the 4-byte jpeg header and build the bufferedimage by&lt;br/&gt;&lt;b&gt;imgData = truncateHeader(imgBytes);&lt;/b&gt;&lt;br/&gt;&lt;b&gt;ImageIO.read(new ByteArrayInputStream(imgData));&lt;/b&gt;&lt;br/&gt;then i obey your suggestion about using jpegimageencoder&lt;br/&gt;&lt;b&gt;ByteArrayOutputStream baos = new ByteArrayOutputStream();&lt;br/&gt;JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(baos);&lt;br/&gt;encoder.encode(image);&lt;br/&gt;imgBytes2 = baos.toByteArray();&lt;/b&gt;&lt;br/&gt;now; when i compare the first byte representation with the last one, i get no equalty and get different lengths.&lt;br/&gt;&lt;b&gt;boolean bool1 = imgBytes.toString().equals(imgBytes2.toString());&lt;/b&gt;&lt;br/&gt;i was expecting to get equal byte arrays with this process..so what might be wrong here? any suggestions?</description>
		<content:encoded><![CDATA[<p><!--INFOLINKS_ON-->Hi, i have problems about jpeg encoding/decoding. <br />i read jpeg data from xml tree by <br /><b>str1 = imgEl.getChild(&#8220;jpegdata&#8221;).getText();</b><br />and then decode it by <br /><b>imgBytes = Base64.decode(str1);</b><br />then i truncate the 4-byte jpeg header and build the bufferedimage by<br /><b>imgData = truncateHeader(imgBytes);</b><br /><b>ImageIO.read(new ByteArrayInputStream(imgData));</b><br />then i obey your suggestion about using jpegimageencoder<br /><b>ByteArrayOutputStream baos = new ByteArrayOutputStream();<br />JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(baos);<br />encoder.encode(image);<br />imgBytes2 = baos.toByteArray();</b><br />now; when i compare the first byte representation with the last one, i get no equalty and get different lengths.<br /><b>boolean bool1 = imgBytes.toString().equals(imgBytes2.toString());</b><br />i was expecting to get equal byte arrays with this process..so what might be wrong here? any suggestions?<!--INFOLINKS_OFF--></p>
]]></content:encoded>
	</item>
</channel>
</rss>

