Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Animating a PNG example: Semantics unclear? #94

Closed
josephg opened this issue Feb 16, 2021 · 2 comments
Closed

Animating a PNG example: Semantics unclear? #94

josephg opened this issue Feb 16, 2021 · 2 comments

Comments

@josephg
Copy link
Contributor

josephg commented Feb 16, 2021

In section 5.1 it has this example:


     Request:
       GET /animated-braid.png
       Subscribe

     Response:
       HTTP/1.1 209 Subscribe
       Subscribe
       Content-Type: image/png         | Version
       Patches: 2                      |
                                       |
       Content-Length: 1239            | | Patch
       Content-Range: bytes=100-200    | |
                                       | |
       <binary data>                   | |
                                       |
       Content-Length: 62638           | | Patch
       Content-Range: bytes=348-887    | |
                                       | | 
       <binary data>                   | |

This is a weird use case:

  • Its almost impossible to figure out a binary patch to a PNG because the content is internally gzipped iirc. (if you do, you'll probably end up with a patch that just replaces the entire contents of the file)
  • Its unclear whether this overwrites the specified bytes or truncates? Like, what happens if the new content is smaller than the old content? (And I might be revealing my ignorance of the content-range: bytes= header by asking this, but how does this format indicate the size of the file should be truncated?

The example might be better either:

  • Using a bitmap instead of a PNG - because then the byte ranges at least make a bit of sense, and the file size will stay constant
  • Or don't use patches in this example, and simply re-send the content with each change
    • And we can write a second example which uses patches
@canadaduane
Copy link
Member

A better example might also be modifying HTML from the server in an "animated" sort of way.

@toomim
Copy link
Member

toomim commented Aug 21, 2023

Closing as duplicate of #77

@toomim toomim closed this as not planned Won't fix, can't repro, duplicate, stale Aug 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants