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

Allow PDF files for the thumbnail generation #1297

Merged
merged 3 commits into from
Sep 16, 2020
Merged

Conversation

ajay-gupta
Copy link
Contributor

Q A
New feature? yes
BC breaks? no

We can allow PDF files as well for the thumbnail generation which does not require any additional code changes in the bundle.

Please preview and merge.

Copy link
Member

@dbu dbu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if everything else works with pdf, we should indeed allow that here, thanks for the PR. i have one question

@dbu
Copy link
Member

dbu commented Sep 15, 2020

can you please adjust the test DataManagerTest::testThrowsIfMimeTypeNotImageOneOnFind and testThrowsIfLoaderReturnBinaryWithMimeTypeNotImageOneOnFind to the new exception message? (see travis-ci build)

@ajay-gupta
Copy link
Contributor Author

can you please adjust the test DataManagerTest::testThrowsIfMimeTypeNotImageOneOnFind and testThrowsIfLoaderReturnBinaryWithMimeTypeNotImageOneOnFind to the new exception message? (see travis-ci build)

Is it only changes in exception message or something more? Please guide.

@dbu
Copy link
Member

dbu commented Sep 16, 2020

yes, just the expected message. you can find the phpunit output by clicking on "Details" in the continous-integration/travis-ci/pr line, which leads you e.g. to https://travis-ci.org/github/liip/LiipImagineBundle/jobs/727345430 . ignore the warning and the skipped tests, what is left is the two DataManagerTest failures.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 72.871% when pulling f41e8ce on ajay-gupta:master into 93ca0f4 on liip:master.

@ajay-gupta
Copy link
Contributor Author

Please review.

@dbu dbu merged commit d2ec6d5 into liip:master Sep 16, 2020
@dbu
Copy link
Member

dbu commented Sep 16, 2020

thanks a lot for this improvement!

@Seb33300
Copy link

#1122...

@garak
Copy link
Contributor

garak commented Jan 8, 2021

How is pdf thumbnail is supposed to work?
I tried in a project of mine to generate pdf thumbnails without changing code, but it doesn't work. It generates a pdf in my cache file (not an image)

@ajay-gupta
Copy link
Contributor Author

ajay-gupta commented Jan 8, 2021

It generates file of mime type - image only (file extension will not change). It is working and rendering correctly for example:
<img src="{{ file.pdf | imagine_filter('medium') }}" />

@garak
Copy link
Contributor

garak commented Jan 12, 2021

Solved by forcing format in configuration. Thank you!

@Seb33300
Copy link

How is pdf thumbnail is supposed to work? I tried in a project of mine to generate pdf thumbnails without changing code, but it doesn't work. It generates a pdf in my cache file (not an image)

I have the same issue, the generated thumbnail file is a PDF (not only the extension .pdf, if I edit the file with notepad I can see it starts by %PDF-1.4).
Is there any way to force the format only for PDF?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants