BookStack icon indicating copy to clipboard operation
BookStack copied to clipboard

Image picker broken after uploading image with large resolution

Open antontkv opened this issue 4 years ago • 5 comments

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):

  • Exact BookStack Version (Found in settings): v0.31.4
  • PHP Version: 7.4
  • Hosting Method (Nginx/Apache/Docker): Bookstack and Apache inside Docker container, reverse proxy with Nginx on the host.

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

antontkv avatar Feb 15 '21 05:02 antontkv

I tested this on the demo, gave me a 502

hwcltjn avatar Feb 18 '21 01:02 hwcltjn

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

critchtionary avatar Mar 23 '21 11:03 critchtionary

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.

ssddanbrown avatar Mar 23 '21 23:03 ssddanbrown

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

Adrian-at-CrimsonAzure avatar Aug 04 '21 11:08 Adrian-at-CrimsonAzure

Are there any good solutions to this? Edit: In my case I was able to fix this by setting the "memory_limit" of the PHP Settings in the plesk admin panel to 256M.

S1lander avatar May 08 '25 06:05 S1lander