Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #5658

Re: Export

From Chris Degnen <degnen@cwgsy.net>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Export
Date 2011-10-15 10:05 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <j7blt8$34m$1@smc.vnet.net> (permalink)
References <h4h1vr$ic3$1@smc.vnet.net>

Show all headers | View raw


This summary of your bug works in version 8:

rose = Import["ExampleData/rose.gif"];
gif = ExportString[rose, "GIF"];
encoded = ExportString[gif, "Base64"];
ImportString[encoded, "Base64"]

and this modified version also works in version 7:

rose = Import["ExampleData/rose.gif"];
encoded = ExportString[rose, {"Base64", "GIF"}];
ImportString[encoded, "Base64"]


On Jul 26 2009, 8:52 am, Hannes Kessler <HannesKess...@hushmail.com>
wrote:
> Hello,
>
> exportingaMathematicaexpressionto animagefile, base64 encoding
> thatfileseems to work improperly. This can be be shown for example
> by re-importing the encodedfiletoMathematica: Import or create anyimageas an example
>
> rose = Import["ExampleData/rose.gif"]
>
> Exportingand re-importing as either GIF or Base64 works:
>
> ImportString[ExportString[rose, "Base64"], "Base64"]
> ImportString[ExportString[rose, "GIF"], "GIF"]
>
> However, let us now export theimageto GIF or any otherimageformat
> and base64 encode the GIF
>
> gif = ExportString[rose, "GIF"];
> encoded = ExportString[gif, "Base64"];
>
> Re-importing the encoded version without specified format gives a list
> of still encoded strings:
>
> ImportString[encoded]
>
> Re-importing the encoded version with specified format fails giving an
> error messages "Import::fmterr : Cannot import data as GIF format"
> followed by further error messages
>
> ImportString[encoded, "Base64"]
>
> Did I miss something or is this a bug of Export? By the way, my
> purpose ofexportinga base64 encodedimageis to modify Microsoft
> Word files in XML format as Word stores images in this form.
>
> Best regards,
> Hannes

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: Export Chris Degnen <degnen@cwgsy.net> - 2011-10-15 10:05 +0000

csiph-web