Displayed image size on the web is bigger than uploaded #1426

Closed
opened 2026-02-05 00:52:13 +03:00 by OVERLORD · 3 comments
Owner

Originally created by @hhk7734 on GitHub (Oct 28, 2019).

Describe the bug
Image size on bookstack is bigger than the original uploaded image.
So I think that page loading is slow.
I'm not sure it is a bug.

example page
On this page, the uploaded image size is 145 kB. But the displayed image size is 500kB.

Steps To Reproduce
Upload image

Expected behavior
Displayed image size on the web is bigger than uploaded.

Your Configuration (please complete the following information):

  • Exact BookStack Version (Found in settings): 0.27.5
  • PHP Version: PHP 7.2.19
  • Hosting Method (Nginx/Apache/Docker): Apache/2.4.29
Originally created by @hhk7734 on GitHub (Oct 28, 2019). **Describe the bug** Image size on bookstack is bigger than the original uploaded image. So I think that page loading is slow. I'm not sure it is a bug. [example page](https://docs.loliot.net/books/sam/page/arduino-due-sam3x8e) On this page, the uploaded image size is 145 kB. But the displayed image size is 500kB. **Steps To Reproduce** Upload image **Expected behavior** Displayed image size on the web is bigger than uploaded. **Your Configuration (please complete the following information):** - Exact BookStack Version (Found in settings): 0.27.5 - PHP Version: PHP 7.2.19 - Hosting Method (Nginx/Apache/Docker): Apache/2.4.29
OVERLORD added the 🛠️ Enhancement🐛 Bug🏭 Back-End labels 2026-02-05 00:52:13 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Oct 30, 2019):

Thanks for finding and reporting @hhk7734, Quite a strange one.

It looks like the original image is well optimized, with thee main benefit of having indexed colours which keeps the file sizes small. Our resizing undoes these optimizations in it's operation thus resulting in a larger image size.

Think we'll just need to check over the image content resize system here to make it a little smarter, So it at least compares file sizes and uses the original if no size change benefit.

If you need a work-around for now there should be an 'Edit HTML' button within the editor, You can find the image HTML in that and replace the src attribute content of the image with a link to the original image file (https://docs.loliot.net/uploads/images/gallery/2019-10/arduino-due-pin-map.png)

@ssddanbrown commented on GitHub (Oct 30, 2019): Thanks for finding and reporting @hhk7734, Quite a strange one. It looks like the original image is well optimized, with thee main benefit of having indexed colours which keeps the file sizes small. Our resizing undoes these optimizations in it's operation thus resulting in a larger image size. Think we'll just need to check over the image content resize system here to make it a little smarter, So it at least compares file sizes and uses the original if no size change benefit. If you need a work-around for now there should be an 'Edit HTML' button within the editor, You can find the image HTML in that and replace the `src` attribute content of the image with a link to the original image file (https://docs.loliot.net/uploads/images/gallery/2019-10/arduino-due-pin-map.png)
Author
Owner

@ssddanbrown commented on GitHub (Dec 22, 2019):

Thanks again @hhk7734, Have applied a patch (32e7f0a2e6) to master, will be in the next release (v0.28) which is due out at the end of the year.

@ssddanbrown commented on GitHub (Dec 22, 2019): Thanks again @hhk7734, Have applied a patch (32e7f0a2e672226384f58a0f7ba96e0b17535d4a) to `master`, will be in the next release (v0.28) which is due out at the end of the year.
Author
Owner

@hhk7734 commented on GitHub (Dec 22, 2019):

@ssddanbrown
Bookstack is soooo cool.
I'm glad I was able to help you. :) 👍

@hhk7734 commented on GitHub (Dec 22, 2019): @ssddanbrown Bookstack is soooo cool. I'm glad I was able to help you. :) 👍
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#1426