V8-archive: The thumbnailer component does not produce thumbnail for PDF files.

Created on 3 Jul 2019  Â·  9Comments  Â·  Source: directus/v8-archive

Bug Report

The thumbnailer component does not produce thumbnail for PDF files. (regression?)

Steps to Reproduce

  1. Upload a PDF file to Directus (here file.pdf)
  2. set the URL to http://http:///thumbnail/_/200/200/crop/good/file.pdf
  3. The file is not found

Expected Behavior

A thumbnail of a PDF is computed and viewable.

Actual Behavior

An 404 error is sent

Other Context & Screenshots

Please note that thumbnailer is working with PNG or JPEG files.

Technical Details

  • Device: Server
  • OS: Ubuntu 18.04.2 LTS
  • Web Server: nginx/1.14.0 (Ubuntu) with location configured for thumbnail
  • PHP Version: 7.2.19-0ubuntu0.18.04.1
  • Database: MySQL 5.7.26-0ubuntu0.18.04.1
  • Install Method: git clone of master branch
bug

Most helpful comment

I was also referring to the docs when labeling this as a bug, but I do agree that this is more of a feature request. Let's either:

  1. Remove support from the docs and make sure there's a ticket on the app for showing the file type for unknown files (instead of the broken image icon)

Or...

  1. Find a PHP extension that will get this working and update the docs.

All 9 comments

Is this definitely a bug @benhaynes ? Currently, thumbnails are only generated for image-types (GIF/PNG/JP(E)G/ Etc) ... IMO, I would consider it an enhancement to display thumbnails for files too.

@shealavington

The library which we are using to generate thumbnail is only supporting the image and not supporting the video, pdf, ms-office, and word. We need to find the libraries which will support these formats.

For a quick patch, we can replace the broken image with the icon of respected format. Otherwise agree with you. We need to consider it as a feature request.

>

To add thumbnail support for SVG, PDF, PSD and TIF/TIFF you must also
install the imagick extension.

Quoting the PHP extensions part of the documentation
https://docs.directus.io/advanced/requirements.html#php-extensions

It seemed it was working before from
https://github.com/directus/directus/issues/453

On Thu, Jul 4, 2019 at 12:37 PM Binal Gajjar notifications@github.com
wrote:

@shealavington https://github.com/shealavington

The library which we are using to generate thumbnail is only supporting
the image and not supporting the video, pdf, ms-office, and word. We need
to find the libraries which will support these formats.

For a quick patch, we can replace the broken image with the icon of
respected format.

So yes agree with you. We need to consider it as a feature request.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/directus/api/issues/1081?email_source=notifications&email_token=AAEI3FU3ITCER2EDP5XFFBLP5XHIHA5CNFSM4H5JUM62YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZHBSBI#issuecomment-508434693,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAEI3FVKZEQ4CKSCPDR2HVTP5XHIHANCNFSM4H5JUM6Q
.

I was also referring to the docs when labeling this as a bug, but I do agree that this is more of a feature request. Let's either:

  1. Remove support from the docs and make sure there's a ticket on the app for showing the file type for unknown files (instead of the broken image icon)

Or...

  1. Find a PHP extension that will get this working and update the docs.

@rijkvanzanten Please let us know your thoughts, should we handle it at App side?
I this we should go with Point 1 in above Ben's comment.

In fact all the code to handle the non image format already exists in the
Thumbnail class.

I hope to send a PR by tomorrow.

On Tue, Jul 9, 2019 at 8:29 AM Kaushal Gajjar notifications@github.com
wrote:

@rijkvanzanten https://github.com/rijkvanzanten Please let us know your
thoughts, should we handle it at App side?
I this we should go with Point 1 in above Ben's comment.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/directus/api/issues/1081?email_source=notifications&email_token=AAEI3FQOEKACBC7GK2WTDOLP6QV3XA5CNFSM4H5JUM62YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZPHR2I#issuecomment-509507817,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAEI3FTIC5U3WJW3E34P3DLP6QV3XANCNFSM4H5JUM6Q
.

Hi @iiome We are looking forward to your PR. Thanks a lot for your help.

I would like to clear one thing.
The code you are referring is dependent on ImageMagick library, which is an additional server requirement. So we also need to add the fallback in case the library is not available.

The app uses the thumbnail URL as returned by the api. If there's no thumbnail, the api shouldn't return this URL in the first place :)

@rijkvanzanten I will make necessary changes in the API and make sure the data.thumbnails key only available for the image files only.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cdwmhcc picture cdwmhcc  Â·  3Comments

vuhrmeister picture vuhrmeister  Â·  3Comments

ondronix picture ondronix  Â·  3Comments

HashemKhalifa picture HashemKhalifa  Â·  3Comments

Varulv1997 picture Varulv1997  Â·  3Comments