Resized images are sometimes larger than before



  • While my users are uploading images all day long, my disk space goes down pretty fast and I wanted to see why. One thing I found is that NodeBB seems to resize every uploaded image, I suspect to have it better fit the page.

    However, this sometimes leads to larger files than the uploaded ones. Here are a couple of examples:

    -rw-r--r-- 1 curv curv  207941 Mar 18 18:41 1521394868838-teig-formen1.jpg
    -rw-r--r-- 1 curv curv  439097 Mar 18 18:41 1521394868838-teig-formen1-resized.jpg
    

    This is an increase by 50%. But this one is even worse:

    -rw-r--r-- 1 curv curv   71110 Mar 18 15:55 1521384951269-fb_img_1520771555885.jpg
    -rw-r--r-- 1 curv curv  440592 Mar 18 15:55 1521384951269-fb_img_1520771555885-resized.jpg
    

    The resized image is 6 times larger!

    I'd consider this a bug, since IF NodeBB wants to resize an image, the result should be smaller in any case. Especially if downsizing from 1048px width to 760px width like the first example. The second image is a comic image containing only 8 colors.

    It would be better if it wouldn't resize such small images at all.

    It seems to me that resized images are uncompressed which is why they are larger.

    • Tom

  • Admin

    Can you file this as an issue on our github page, in the meantime you can disable the resizing of images to 760 by setting the setting to 0 in the ACP.

    0_1521474631094_8bb8dbf4-aec6-4965-b59c-463939239263-image.png


  • Admin

    This is fixed https://github.com/NodeBB/NodeBB/issues/6373, will be available in 1.8.1



  • Now, that was fast. Wow!

    Thanks a lot,
    Tom


 

| |