mod_pagespeed doesn't resize png files

114 views
Skip to first unread message

Dmitrii Kustov

unread,
Mar 11, 2015, 12:35:53 PM3/11/15
to mod-pagesp...@googlegroups.com
Hello, brainiac comrads!

Here is the problem i'm seeing for the first time:

mod_pagespeed doesn't want to resize png images to smaller size. It works fine with jpgs though. and it does "optimize" (caches i guess) pngs, but doesn't resize them though.

here is original code:


<img class="img-responsive" src="/images/family-law-lawyers.png?date=3-11-15" width="668" height="321" alt="Family law lawyers in Sugar Land, TX"/>

and here is what i see after pagespeed module does it's stuff:

<img class="img-responsive" src="images/family-law-lawyers.png,qdate=3-11-15.pagespeed.ce.dk0z-rJuAx.png" alt="Family law lawyers in Sugar Land, TX" height="321" width="668">

As you can see, it does something, but not the size. Additionally, whenever MPS usually resizes the image, it adds new dimensions to the beginnning of the name of the file:

images/455x116xhouston-top-lawyers.jpg.pagespeed.ic.yVtG82fFdd.jpg

what is not happening to png.

Here is my image related filters:

   ModPagespeedEnableFilters dedup_inlined_images
   ModPagespeedEnableFilters lazyload_images
   ModPagespeedLazyloadImagesAfterOnload off
    ModPagespeedEnableFilters inline_images
    ModPagespeedEnableFilters resize_rendered_image_dimensions 
    ModPagespeedEnableFilters resize_images
    ModPagespeedEnableFilters convert_jpeg_to_progressive
    ModPagespeedEnableFilters convert_jpeg_to_webp
    ModPagespeedEnableFilters jpeg_subsampling
    ModPagespeedEnableFilters recompress_jpeg
    ModPagespeedEnableFilters recompress_png
    ModPagespeedEnableFilters recompress_webp
    ModPagespeedJpegRecompressionQuality 75

P.S.: using "1.9.32.2-4321" MPS version. and here is the patient: http://www.fosterlawfirm.com/  - look in the header, pic of three men, on mobile view.

Jeff Kaufman

unread,
Mar 11, 2015, 12:56:54 PM3/11/15
to mod-pagespeed-discuss, Huibao Lin
When I load www.fosterlawfirm.com/?PageSpeedFilters=+debug it gives
some extra debugging information. For that image I see:

<!--Cannot resize: RGBA_8888 pixel format--><!--Image has transparent
pixels and is sensitive to compression noise.--><!--The image was not
inlined because it has too many bytes.-->

The first pagespeed-injected debug comment explains the problem: it's
in a format we can't resize. I'm not sure why that is? Looking in
the code that's a specific exclusion (if RGBA_8888 then log error and
return). The problem is that the PNG has an alpha channel. My memory
is that we couldn't fix this until we did some refactoring, which
we've now done, so this is something Huibao should be able to work on
when he has time.

You can track this here: https://github.com/pagespeed/ngx_pagespeed/issues/403
> --
> You received this message because you are subscribed to the Google Groups
> "mod-pagespeed-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mod-pagespeed-di...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mod-pagespeed-discuss/acf984bd-19b1-4522-a44b-109d1f938b41%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Dmitrii Kustov

unread,
Mar 11, 2015, 2:06:41 PM3/11/15
to mod-pagesp...@googlegroups.com, hui...@google.com
Thanks a lot!
Reply all
Reply to author
Forward
0 new messages