views:

262

answers:

2

I am having an issue rendering images in flash via a character array. I am sending it from a webhandler via Context.Response.Write as a Base64CharacterArray. It functions 100% properly in a windows environment, however when using a Mac the image data is not retrieved correctly causing the image to appear incorrectly. It does not affect the data,however as it is rendered properly in a player which accesses the data via a webservice. I am at the end of my rope on this one. Anything will help.

You can find an example at the following url http://www.discoverirelandtoday.com/photoalbum/Public/Main.aspx

Thanks

A: 

Just a guess, but perhaps check the content type of the response... Also, you can try flushing the response.

set the content type like this: Response.ContentType = "image/jpg"; //I'm not sure what content type you'll need.

Flush like this: Response.Flush();

Lance Fisher
A: 

I don't know what your example is trying to tell me. It's a fine looking site, but I'm not clear how it shows your issue. We'd probably rather see some simple code examples of what you're trying to do.

Anyway, since you're trying to manipulate bits and the problem is platform dependent, could you be running into a big-endian/little-endian issue? http://www.cs.umass.edu/~Verts/cs32/endian.html This could be a long shot, but your Base64 library might be doing something the mac doesn't like: (source code posted by Software Monkey here for decoding mentions big-endian)

Another platform specific issue might be line-endings. Unix-like systems use LF to end lines whereas windows uses (ref). Doesn't seem like you should have any newlines in your image data, but we don't see your data.

You can also try running some tests. Try sending some very simple bitmap images and see how they get rendered. e.g., all black pixels, all white pixels, all red, RGB/BRG/GBR, etc... If you can predict how the image is getting corrupted, it might be a clue.

Glenn