media-command icon indicating copy to clipboard operation
media-command copied to clipboard

No thumbnail when importing PDF file using `media import`

Open ernilambar opened this issue 11 months ago • 2 comments

Bug Report

Describe the current, buggy behavior

I tried importing same file using CLI and from the admin panel. Uploading through admin panel, thumbnail is generated but using media import command, thumbnail is not generated.

Describe how other contributors can replicate this bug

  • Download http://wp-cli.org/behat-data/minimal-us-letter.pdf file
  • wp media import ~/Downloads/minimal-us-letter.pdf
  • File is imported but there is no thumbnail. (Ref: screenshot)
  • Upload using admin panel then thumbnail is generated.

Describe what you would expect as the correct outcome

Thumbnail should be generated correctly.

Let us know what environment you are running this on

OS:     Darwin 22.6.0 Darwin Kernel Version 22.6.0: Tue Nov  7 21:48:06 PST 2023; root:xnu-8796.141.3.702.9~2/RELEASE_X86_64 x86_64
Shell:  /bin/zsh
PHP binary:     /usr/local/bin/php
PHP version:    8.2.17
php.ini used:   /usr/local/etc/php/8.2/php.ini
MySQL binary:   /usr/local/mysql-8.0.36-macos14-x86_64/bin/mysql
MySQL version:  mysql  Ver 8.0.36 for macos14 on x86_64 (MySQL Community Server - GPL)
SQL modes:
WP-CLI root dir:        /Users/nilambarsharma/Code/wp-cli-dev/wp-cli
WP-CLI vendor dir:      /Users/nilambarsharma/Code/wp-cli-dev/wp-cli/vendor
WP_CLI phar path:
WP-CLI packages dir:    /Users/nilambarsharma/.wp-cli/packages/
WP-CLI cache dir:       /Users/nilambarsharma/.wp-cli/cache
WP-CLI global config:
WP-CLI project config:  /Users/nilambarsharma/Sites/clean/wp-cli.local.yml
WP-CLI version: 2.11.0-alpha

Provide additional context/Screenshots

Screenshot 2024-03-20 at 12 43 05 PM

ernilambar avatar Mar 20 '24 07:03 ernilambar

I have checked and got the same https://prnt.sc/cfwhP6gjD9n6

murshed avatar Apr 26 '24 10:04 murshed

Please ensure imagick is installed while we import the PDF. It helps in generating previews for PDFs.

Please run php -m command to check the installed package & see if we have imagick installed. 😄

Screenshot 2024-04-26 at 8 35 42 PM

Pathan-Amaankhan avatar Apr 26 '24 15:04 Pathan-Amaankhan

Looks like actually the imagick issue. I tested in another setup and it is working fine. Closing issue.

ernilambar avatar May 14 '24 04:05 ernilambar