BookStackApp / BookStack

A platform to create documentation/wiki content built with PHP & Laravel
https://www.bookstackapp.com/
MIT License
14.67k stars 1.85k forks source link

Image picker broken after uploading image with large resolution #2562

Open antontkv opened 3 years ago

antontkv commented 3 years ago

Describe the bug After uploading image with high resolution, 10425x8499 in my case. There is 500 error after upload and image picker breaks. It always shows loading animation. I can fix that by deleting uploaded image from uploads/images/gallery. My guess that bookstack can't create thumbnail of the image, because there is no new image in thumbs-150-150 directory.

Steps To Reproduce Steps to reproduce the behavior:

  1. Go to Editing the page
  2. Click on Insert an Image
  3. Upload big image
  4. See error

Screenshots image image

Your Configuration (please complete the following information):

Additional context I attach image that can help reproduce this issue. bigimage

hwcltjn commented 3 years ago

I tested this on the demo, gave me a 502

critchtionary commented 3 years ago

I get the same issue on Bookstack 0.29.3 with a 7047x4888 image.

ssddanbrown commented 3 years ago

Just been testing this. This will be due to thumbnail system needing a lot of resources to process the image. If you max the system resources your php process will be killed and you'll get an error.

It'll generally be due to memory availability. This is where a bit of swap space can help if possible in your environment.

Adrian-at-CrimsonAzure commented 3 years ago

I'm also having this issue with a 32MB map I'm trying to upload which is admittedly absolutely massive.