Shop OBEX P1 Docs P2 Docs Learn Events
Spinneret and PNG images — Parallax Forums

Spinneret and PNG images

FinnCAFinnCA Posts: 11
edited 2011-04-20 13:13 in Accessories
I have been trying to figure out why my spinneret always is getting hung and I think I found the problem. In safari on mac, I opened the activity window to see why the page was taking so long to load and I found that all of the images being requested had timed out. All of these images were PNGs. I have PNG in the content header. I have no idea what is wrong. Does anyone have a suggestion?

FinnCA

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-04-17 15:26
    I, too, had problems with images not loading. 'Never did solve it, really, but was able to work around it:

    -Phil
  • FinnCAFinnCA Posts: 11
    edited 2011-04-17 16:42
    Until there is a fix, I am going to just encode the PNGs in Base64 data. This seems to be the only way to load images at the moment. I hope we can find a fix soon.
  • Mike GMike G Posts: 2,702
    edited 2011-04-17 16:51
    I've been working on this issue all week. My wife is ecstatic and my grass is long.

    I ended up modifying the Indirect driver to write all 4 status registers to HUB memory while the PASM code is waiting for a command. In the server code I spin up a method that monitors all 4 status registers. I just got the monitor working.

    The idea is to always have one listener available. If socket 0 is working (not status 0x14) then start the next available socket.
  • Mike GMike G Posts: 2,702
    edited 2011-04-17 17:02
    Until there is a fix, I am going to just encode the PNGs in Base64 data. This seems to be the only way to load images at the moment. I hope we can find a fix soon.

    I thought the issue was available sockets. How does converting a PNG to Base64 work? Is the base 64 encoded in the source web page? You're not using <img src="some file" />?
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-04-17 17:29
    It's this:
    <img src="data:image/ico;base64,
    AAABAAEAEBAAAAAAAABoBQAAFgAAACgAAAAQAAAAIAAAAAEACAAAAAAAAAEAAAAAAAAAAAAAAAEA
    AAAAAACgoqMAtLa6AFhRRABrZ2EAfXx7AEEpBABCKwEASkEwAF5WSgC9vsAAmJiYAEQxEwCFhYQA
    YV1WAK6wsgBENR8Ad3h5AFhQQgA/KAIASEAuAD4qCAA/KggAPS4UAEIuCwCqq60AUE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AAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    AAAAZ2dFi2dnZ2dnZ2dnZ2gFUooLDRlpZ2dnZ2dnZ4prZ2ckgyyYRYpnZ2dnZ2eKUmdnJWBOfTWK
    Z2dnZ2dnZ2cWZyRCnTo1ioqKioqKVmdWZ2ckYZqWFSZYW1s5eESKVlk9VEIqLWKCCjhaIQwDTzaM
    R1RCCUswZjdjhXU4GA4uFIlUTW90VVcoKDsoZStyhicjJV6OHWSKjIyMjFkfkX93MopdAJxkimdn
    Z2dniDOedhJoGkk8HohTUVFRh4QIgEFQaA8QP18xIgIgEZIvmUqXiiRzG0YcKUyUQAF5QwSbNGeP
    FwdIPm5+XHBxE4FXVgYGao9senqVbXx7k5CPjWpqagAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=" />
    

    This was an ico file, but the same principle works with other image formats.

    -Phil
  • Mike GMike G Posts: 2,702
    edited 2011-04-17 17:50
    Thanks Phil... That's a pain in the butt, clever.
  • Mike GMike G Posts: 2,702
    edited 2011-04-17 19:08
    Here's my status monitor work.
  • FinnCAFinnCA Posts: 11
    edited 2011-04-17 19:38
    The Base64 encoding method I mentioned earlier seems to be working like a charm. Mike does your new code with the status monitor seem to eliminate the problem? I have not had time to test it yet, but I downloaded your code from this morning and it seems to work great (other than having to encode the images).
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-04-17 23:49
    Do all modern browsers now accept "src=data" for most image formats as well as for large image sizes? There used to be rather severe limits for each. I just wonder if things have loosened up a bit.

    -Phil
  • Mike GMike G Posts: 2,702
    edited 2011-04-18 05:57
    After reading Phil's post and doing a lite Internet search it appears that all new browsers support src=data. I did not test it though.

    @FinnCA, I only have the monitor wired up, no consuming logic. Also, I'm not sure how well it will integrate with the current Indirect Driver. I'm fairly sure that I'll need to make driver changes. Finally, this will not totally fix the problem because we only have 4 available sockets.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-04-20 13:13
    I've posted an on-the-fly base64 converter object here:

    Hopefully, it will make base64-encoded images less of a pain to implement.

    -Phil
Sign In or Register to comment.