Skip to content

Reduce bandwidth usage of images by converting to either JSON or PNG #1

@gitchly

Description

@gitchly

Fabric.js has a feature which allows us to serialize a canvas to a JSON object. In some cases, this may be a lot smaller than the base64 PNG representation of the image, and it might be worth sending this over the network in order to save bandwidth.

See http://fabricjs.com/docs/fabric.Canvas.html#toJSON

This would require changing both the client and server-side javascript to implement.

Client side changes:

  • Client would need to convert image to both PNG and JSON, compare the sizes, and send the smallest one (shortest string).
  • Upon receiving image data from the server, the client would need to parse whether it's a PNG or JSON and display it appropriately

Server side changes:

  • Server image validation would need to be changed to account for the different types of data

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions