Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Image information in XML

From: "Pete Cordell" <petexmldev@--------------.--->
To: "Shashikala Shamarao" <shashikala_shamarao@-----.--->, <xmlschema-dev@--.--->
Date: 9/29/2005 6:48:00 PM
Hi Shashi,

What I meant was, you can do:

JPEG -> base64 -> XML -> compress,

(and the size is comparable to JPEG -> XML assuming your JPEG data is 
significantly larger than your XML text data)

but you can't do:

JPEG -> base64 -> compress -> XML

as in the latter case you are back to a binary in XML problem.

I think it's theoretically possible to set the first case up as a streaming 
pipeline so that intermediate storage of all objects is not required, but 
whether there are any off the shelf implementations to do that I don't know.

Whether its acceptable performance for your application is harder to comment 
on.

Pete.
--
----- Original Message ----- 
From: "Shashikala Shamarao" <shashikala_shamarao@y...>
To: "Pete Cordell" <petexmldev@t...>; <xmlschema-dev@w...>
Sent: Thursday, September 29, 2005 5:03 PM
Subject: Re: Image information in XML


> Hi Pete,
>
> Yes, I did figured out. But I still do not know how efficient it will be 
> with regards to performance. That is for example, if we have lots of 
> images in each document, we need to base64 encode the images and then 
> compress it before embedding it into XML. I am currently testing this part 
> to analyse the performance.
>
> Thanks again
> Shashi
>
> Pete Cordell <petexmldev@t...> wrote:
>
> Hi Shashi,
>
> Yes. You can compress the whole of the XML message with the image data
> contained in it. Just looking at the JPEG part of a payload I did some
> quick tests and it seems that compressing would compensate for the base64
> expansion:
>
> JPEG file: 105,482 bytes (where , has its UK meaning)
> JPEG -> ZIP file: 105,417 bytes (implies JPEG is working well!)
> JPEG -> Base64 file: 144,346 bytes (includes some extra line feeds in
> addition to 4/3 expansion)
> JPEG -> Base64 -> ZIP file: 109, 293 bytes
>
> This does show that compressing can get back much of what you loose by
> Base64 encoding.
>
> Regards,
>
> Pete.
> --
> =============================================
> Pete Cordell
> Tech-Know-Ware Ltd
> for XML to C++ data binding visit
> http://www.tech-know-ware.com/lmx
> (or http://www.xml2cpp.com)
> =============================================
>
> ----- Original Message ----- 
> From: "Shashikala Shamarao"
> To: "Pete Cordell"
> ;
> Sent: Wednesday, September 28, 2005 10:56 PM
> Subject: Re: Image information in XML
>
>
>> Hi Pete,
>>
>> Thanks for the response. Is it possible to compress the data after it has
>> been encoded.
>>
>> Thanks,
>> Shashi
>>
>> Pete Cordell
> wrote:
>>
>> Hi Shashi,
>>
>> The normal approach is to base64 encode binary data
>> (http://www.faqs.org/rfcs/rfc3548.html) (or hex encode). This does result
>> in some data expansion though. Every 3 bytes will be turned into 4. I
>> don't know of any other solution that would work with a standard XML
>> parser,
>> although some multiple file / out of band technique may work.
>>
>> Pete.
>> ----- Original Message ----- 
>> From: "Shashikala Shamarao"
>> To:
>> Sent: Wednesday, September 28, 2005 12:06 AM
>> Subject: Image information in XML
>>
>>
>>> Hi,
>>>
>>> Currently I am stuck with a problem realted to image in XML.
>>>
>>> I want to know how can I send image information in XML like below.
>>>
>>> My XML response should look like:
>>>
>>>
>>>
>>>
>>> contains binary data
>>>
>>>
>>>
>>> contains binary data
>>>
>>>
>>>
>>> contains binary data
>>>
>>>
>>>
>>>
>>>
>>> I looked at multipart MIME, these define a boundary at the begining say
>>> "bounary1" and at the end of every content whose mime type is different,
>>> boundary will be defined. What I am wondering is, is it possible to
>>> define
>>> boundary for each element , so I can send the bit by bit
>>> information to the parser instead of waiting for the whole document to 
>>> be
>>> created in memory and then sending it to parser?
>>>
>>> Any answers would be appreciated.
>>>
>>> Thanks in advance
>>> Shashi
>> --
>> =============================================
>> Pete Cordell
>> Tech-Know-Ware Ltd
>> for XML to C++ data binding visit
>> http://www.tech-know-ware.com/lmx
>> (or http://www.xml2cpp.com)
>> =============================================
>>
>>
>>
>>
>>
>> __________________________________________________
>> Do You Yahoo!?
>> Tired of spam? Yahoo! Mail has the best spam protection around
>> http://mail.yahoo.com
>
>
>
>
>
> ---------------------------------
> Yahoo! for Good
> Click here to donate to the Hurricane Katrina relief effort. 





transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent