IMPORTANT MESSAGE REGARDING THE FORUM

As you may already know, the JoomlaWorks Forum is powered by Kunena (the only decent forum component for Joomla).

Unfortunately, the latest update for Kunena has seemingly broken all code snippets (old and new) in the forum.

Until this message is removed, please paste any code as regular text - in other words, don't use the [code]...[/code] tags in Kunena's post editor.

Keyword

K2 removing compression on uploaded images

  • PhoenixOmega
  • PhoenixOmega's Avatar Topic Author
  • Offline
  • New Member
More
6 years 5 months ago - 6 years 5 months ago #142560 by PhoenixOmega
K2 removing compression on uploaded images was created by PhoenixOmega
Hello,

I am trying to increase my site's Google Pagespeed Insights score. One of the major gripes it's telling me is that the images that K2 is generating are not losslessly compressed. Here's an exact quote from it:

Losslessly compressing /…e/4786bdc09cc2bea7a6f114db8b9ef4d3_L.jpg could save 26.8KiB (28% reduction).


developers.google.com/speed/pagespeed/insights/

Image optimization is currently a "red" area, which means Google is severely penalizing my score because K2 isn't compressing the images like Google wants.

Now I am using my own tools to compress the original image to 75 kb, but after uploading to K2, the image grows to 127 kb, nearly twice the size of the image that I uploaded, even though it's the same size in pixel dimensions. Attached is the original image that I compressed, and then after that is the image that K2 generated, which as you can see is basically twice the size, which is not good for performance!

http://imgur.com/XljmYzR

http://imgur.com/dcxICBQ

Is there any way to upload an image and prevent K2 from stripping the compression I did?
Last edit: 6 years 5 months ago by PhoenixOmega.

Please Log in or Create an account to join the conversation.

More
6 years 5 months ago #142562 by Joe Campbell
Replied by Joe Campbell on topic K2 removing compression on uploaded images
Hi,

All images uploaded through K2 (other than the via the K2 Media Manager) is processed resulting in a change in:

- file name
- file size
- compression
- possibly dimensions (depending on what options you select)

To avoid this you can use image type extra fields. Please view my previous post that further explains:
www.joomlaworks.net/forum/k2-en/40376-solved-keeping-orginal-names-in-my-images#141480

You also may want to investigate the following online image compression tools:
compressor.io/
kraken.io/

I hope this helps,

Joe Campbell

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
6 years 5 months ago #142583 by Krikor Boghossian
Replied by Krikor Boghossian on topic K2 removing compression on uploaded images
K2 users PHP's GD Library to compress images. Same as WP and other CMS's.

As for not losslessly compressed, this is not possible since .jpg is not a lossless format.

Please Log in or Create an account to join the conversation.

  • PhoenixOmega
  • PhoenixOmega's Avatar Topic Author
  • Offline
  • New Member
More
6 years 5 months ago #142784 by PhoenixOmega
Replied by PhoenixOmega on topic K2 removing compression on uploaded images
Thank you! This was extremely helpful.

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
6 years 5 months ago #142795 by Krikor Boghossian
Replied by Krikor Boghossian on topic K2 removing compression on uploaded images
You 're welcome.

Please Log in or Create an account to join the conversation.

More
6 years 5 months ago #142973 by Joe Campbell

Please Log in or Create an account to join the conversation.

More
4 years 2 weeks ago #163918 by quebecguitare
Replied by quebecguitare on topic K2 removing compression on uploaded images
Hi,

I'm also trying to improve my Google PageSpeed Insights Scoring.

Is it a google idea to find those pictures in the cache take the newly compressed pictures provided by Google Google PageSpeed Insights Scoring and crush the old one?

Any better advice?

If this is a good idea, I can't seems to find these pictures in the /media/k2/items/cache folder.
They are either named differently or I don't have the right path.

Thanks
					
Thank you for your time!

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
4 years 2 weeks ago #163922 by Krikor Boghossian
Replied by Krikor Boghossian on topic K2 removing compression on uploaded images
Hello,

In order to have better compression you need another library apart from PHP's GD library.
This can't be done server-wise since K2 only supports GD.

You can look at libjpeg or pngcrush but these are cli tools mostly.

Please Log in or Create an account to join the conversation.

More
4 years 2 weeks ago #163926 by quebecguitare
Replied by quebecguitare on topic K2 removing compression on uploaded images
Is it possible to only replace the cache files like I suggested, since most of the content is static anyway?

Thank you for your time!

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
4 years 2 weeks ago #163930 by Krikor Boghossian
Replied by Krikor Boghossian on topic K2 removing compression on uploaded images
You can download them use an app for image compression like ImageOptim and reupload them

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum