Skip to content

Base64 image support#5933

Closed
clankill3r wants to merge 2 commits into
processing:masterfrom
clankill3r:base64_image_support
Closed

Base64 image support#5933
clankill3r wants to merge 2 commits into
processing:masterfrom
clankill3r:base64_image_support

Conversation

@clankill3r

Copy link
Copy Markdown

Some time ago poqudrof did some amazing work with extending the support for svg.
#4168

One of the things he worked on was support for base64 images.
Unfortunately this is only for SVG.

To quote him on another aspect:

Here are the bad parts : 

  • I introduce some code duplication in :
private void loadBase64Image() 

Basically his loadBase64Image was some kind of copy of the loadImage of processing.
There where some down sites with that:

  • Error messages are inconsistent (no cmyk error anymore etc.)
  • Error assumed the extension format was 3 chars, so on tiff or jpeg it would report tif and jpe.
  • Due to code duplication it is harder to maintain
  • certain image formats like tga and tiff are no longer supported
  • It assumes that data:image/ is always base64, but this is not always the case

I cleaned things up so the loadImage for the SVG is the loadImage from PApplet now.
And I added support for all the types he did not support with loadImage.

In other words, there is full base64 support now for loadImage.

Here is a gist to check it:

https://gist.github.com/clankill3r/03f4a7dbc64a4b48fbace1912b99c678

@clankill3r clankill3r closed this by deleting the head repository Mar 28, 2023
@github-actions

Copy link
Copy Markdown

This pull request has been automatically locked. Pull requests that have been closed are automatically locked 30 days after the last comment.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Mar 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant