algoo / preview-generator

generates previews of files with cache management
https://pypi.org/project/preview-generator/
MIT License
228 stars 50 forks source link

Regression: PDF preview page of an ODT file is blank #194

Closed inkhey closed 3 years ago

inkhey commented 4 years ago

Due to the fix described in https://github.com/algoo/preview-generator/pull/100#discussion_r303020089, specific PDF page previews of office documents are empty.

regression found here: for unknown reason, using stream instead of file path in get_decrypted_pdf() which use PdfFileReader inside doesn't provide a correct pdf (it result in an empty pdf). see https://github.com/algoo/preview-generator/issues/194

_Originally posted by @inkhey in https://github.com/algoo/preview-generator/pull/100#discussion_r463565867_

Related Tracim issue : https://github.com/tracim/tracim/issues/3401

Implemented solution:

https://github.com/algoo/preview-generator/pull/200 Hack to convert stream in a known working format for pypdf2, this is not an effective solution (as this lead to in memory content), but this does work and is not a regression (we do use the same "code" as pypdf2 itself use for file).

PhilippeAccorsi commented 3 years ago

This regression is visible/exists in Tracim (latest release) ?

inkhey commented 3 years ago

This regression is visible/exists in Tracim (latest release) ?

The fix was added in preview generator 0.15.4 that tracim is using.

PhilippeAccorsi commented 3 years ago

So this issue need to be stay open or can be close ?

inkhey commented 3 years ago

We can close it.