Stirling-PDF icon indicating copy to clipboard operation
Stirling-PDF copied to clipboard

Add: Convert PDF to WebP

Open Ludy87 opened this issue 1 year ago • 8 comments

Description

Please provide a summary of the changes, including relevant motivation and context.

Closes #(issue_number)

Checklist:

  • [x] I have read the Contribution Guidelines
  • [x] I have performed a self-review of my own code
  • [x] I have commented my code, particularly in hard-to-understand areas
  • [x] My changes generate no new warnings

Contributor License Agreement

By submitting this pull request, I acknowledge and agree that my contributions will be included in Stirling-PDF and that they can be relicensed in the future under the MPL 2.0 (Mozilla Public License Version 2.0) license.

(This does not change the general open-source nature of Stirling-PDF, simply moving from one license to another license)

Ludy87 avatar Aug 12 '24 21:08 Ludy87

Looks like we can use PyMuPDF to do pdfto markdown and others

But also this library seems to have a lot of features... What size does this make the docker 👀

Frooodle avatar Aug 14 '24 11:08 Frooodle

give me a moment

Ludy87 avatar Aug 14 '24 13:08 Ludy87

As always, there are problems when creating

Ludy87 avatar Aug 14 '24 19:08 Ludy87

linux/amd64

  • 1.07 GB

linux/arm64

  • 1.02 GB

@Frooodle It seems to have gotten a bit bigger :) I'll try to press it a little more

Ludy87 avatar Aug 15 '24 19:08 Ludy87

.github/workflows/pymupdf.yml must be triggered manually once to build the image - duration 1h After that it is only triggered when the version in the .pymupdf is increased.

The image of latest and fat will increase by about 400-450 MB, unfortunately it will not be any slimmer

Ludy87 avatar Aug 17 '24 19:08 Ludy87

Okay let me think about this, without more features this is a huge file size jump for up Would be good to see what we can grab from this for future

Frooodle avatar Aug 17 '24 19:08 Frooodle

I could try to create mujs, but I don't know anything about it :)

Ludy87 avatar Aug 17 '24 20:08 Ludy87

I removed pymupdf and used pdf2image and pillow instead. The Docker images are now about 5 MB larger. If you want we can use this.

Stirling Docker size

image

Test Docker size

image

Ludy87 avatar Aug 19 '24 21:08 Ludy87