kirby icon indicating copy to clipboard operation
kirby copied to clipboard

File blueprint: error when create/format option is set and document is uploaded

Open JerikoOne opened this issue 1 year ago • 0 comments

Description

When a file blueprint has the format option set so that images get converted to another format, uploading a PDF results in an error imagecreatefromstring(): Data is not in a recognized format . The uploaded file is corrupt due to the conversion process.

Expected behavior
Images should be converted to the format defined in the blueprint. Any other file should be uploaded as is.

Screenshots
image image

To reproduce

  1. Create a new file blueprint or use default file blueprint.
  2. Add the following properties to the blueprint:
create:
  format: webp
  1. Upload a PDF using that blueprint
  2. See error

Your setup

Kirby 4.0.1 up to 4.1

Console output
image First error while uploading. Second error while trying to get a thumbnail for the uploaded PDF that doesn't exist.

Your system (please complete the following information)

  • Device: Macbook
  • OS: macOS
  • Browser: Firefox
  • Version: 122.01

Additional context

JerikoOne avatar Feb 14 '24 17:02 JerikoOne