No need to convert to PDF with LibreOffice, just convert to PNG#10198
Merged
MorrisJobke merged 1 commit intonextcloud:masterfrom Jul 13, 2018
Merged
No need to convert to PDF with LibreOffice, just convert to PNG#10198MorrisJobke merged 1 commit intonextcloud:masterfrom
MorrisJobke merged 1 commit intonextcloud:masterfrom
Conversation
Member
rullzer
reviewed
Jul 11, 2018
| $pdf = new \imagick($pdfPreview . '[0]'); | ||
| $pdf->setImageFormat('jpg'); | ||
| $png = new \imagick($pngPreview . '[0]'); | ||
| $png->setImageFormat('jpg'); |
Contributor
Author
There was a problem hiding this comment.
Don't ask me, that is what the code did originally, too. First it had LibreOffice export to PDF, then converted that to JPG. I just changed that so that it has LibreOffice export to PNG first.
Member
|
@tml1024 thnx! Could you sign off your commit that should do the trick :) |
Exporting all pages of a document to a PDF is a waste of time. All we need is a thumbnail of the first page anyway. Plus, reading that PDF (even just the first page of it) into imagick is presumably much slower than reading a simple PNG. Signed-off-by: Tor Lillqvist <tml@collabora.com>
MorrisJobke
approved these changes
Jul 13, 2018
MorrisJobke
added a commit
that referenced
this pull request
Jul 13, 2018
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
kesselb
added a commit
that referenced
this pull request
Nov 13, 2023
The initial office preview implementation converted an office document with LibreOffice to PDF, used ImageMagick to extract the first page as JPEG, and passed it OC_Image. #10198 changed the implementation to use PNG rather than PDF. OC_Image can use a PNG as a preview right away, so the ImageMagick step is unnecessary. The registration code was updated to not ask ImageMagick if PDF is supported, as PDFs are no longer used to create office document previews. Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
kesselb
added a commit
that referenced
this pull request
Nov 13, 2023
The initial office preview implementation converted an office document with LibreOffice to PDF, used ImageMagick to extract the first page as JPEG, and passed it OC_Image. #10198 changed the implementation to use PNG rather than PDF. OC_Image can use a PNG as a preview right away, so the ImageMagick step is unnecessary. The registration code was updated to not ask ImageMagick if PDF is supported, as PDFs are no longer used to create office document previews. Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
7 tasks
zak39
pushed a commit
to zak39/server
that referenced
this pull request
Dec 19, 2023
The initial office preview implementation converted an office document with LibreOffice to PDF, used ImageMagick to extract the first page as JPEG, and passed it OC_Image. nextcloud#10198 changed the implementation to use PNG rather than PDF. OC_Image can use a PNG as a preview right away, so the ImageMagick step is unnecessary. The registration code was updated to not ask ImageMagick if PDF is supported, as PDFs are no longer used to create office document previews. Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Exporting all pages of a document to a PDF is a waste of time. All we
need is a thumbnail of the first page anyway. Plus, reading that PDF
(even just the first page of it) into imagick is presumably much
slower than reading a simple PNG.