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

Feature Request: Investigate use of WEBP #27

Open
wiesshund opened this issue Jan 8, 2023 · 7 comments
Open

Feature Request: Investigate use of WEBP #27

wiesshund opened this issue Jan 8, 2023 · 7 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@wiesshund
Copy link

Investigate use of WEBP graphics format, to see if it would reduce file size

It may not since B2S stores all images in base64

@JockeJarre JockeJarre changed the title Feature Request Feature Request: Investigate use of WEBP Jan 8, 2023
@JockeJarre JockeJarre added the enhancement New feature or request label Nov 13, 2023
@jueank
Copy link

jueank commented Dec 1, 2023

Wouldn't it be advisable to move away from storing all image data in base64 anyhow? Stop putting binary data into XML.
An alternative could be to have the XML part + binary data (JPEG, WebP, ...) in a file structure and wrap it in ZIP format.
Load times of backglasses would most probably benefit (a lot I guess).

@JockeJarre JockeJarre added the help wanted Extra attention is needed label Dec 1, 2023
@JockeJarre
Copy link
Collaborator

That is a good idea. Actually how many formats today work today (see M$ Office documents for example).
Something you would be able to help us implement? We will of course have to update the designer and server.

@jueank
Copy link

jueank commented Dec 1, 2023

VPX file format works just the same btw. (Try to open a .vpx file with 7-zip)
I will not be able to help implementing it though .

@francisdb
Copy link

VPX uses Compound File Binary Format (CFB or CFBF). Better stick with zip.

@wiesshund
Copy link
Author

wiesshund commented Dec 2, 2023

VPX file format works just the same btw. (Try to open a .vpx file with 7-zip) I will not be able to help implementing it though .

You could, but i am not sure that b2s warrants the complexity involved?
i think standard ZIP format would be fine?

it can retain use of the direcB2S extension.

like
Tablename.directB2S

backglass.xml
image1.png
image2.png
dmdimage.png

@EngineersNeedArt
Copy link

Love to see a container format. ePub uses a container format — other modern file formats are like this.

As mentioned above, folder (directory) is zipped up. Inside you have a manifest (is XML kinda losing out to JSON these days?). The manifest would contain all usual and expected keys — but for images there would instead be a relative file path for the images. They can be in JPG, PNG or whatever formats are allowed. The images are located within the same directory as the manifest (or subdirectories within if you want to allow subdirectories ... bulbs for example could all be within a directory called "Bulbs").

(I have written some C code to parse directB2s files just for my amusement. I export the images currently — am considering exporting a manifest like I describe above just for completeness.)

@EngineersNeedArt
Copy link

Just checked — for a particular directB2s file that weighs in at 10.6 MB, the zipped version (images de-BASE64'd) is 4.6 MB. (Of course I have yet to export the manifest, but I suspect that is in the noise.)

I suppose a not-surprising 50% of the original size.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants