bastianschwarz commented on issue #1876: Image Optimization: Does MPS optimize 
<source> images?
URL: 
https://github.com/apache/incubator-pagespeed-mod/issues/1876#issuecomment-585793294
 
 
   Example output:
   ```html
   <picture><!--[if IE 9]>
     <video style="display: none;"><![endif]-->
     <source 
srcset="[omitted]/images/[unique-image-id]/[seo-friendly-filename].jpeg" 
media="(min-width: 1800px)">
     <source 
srcset="[omitted]/images/[unique-image-id]/[seo-friendly-filename].jpeg" 
media="(min-width: 1500px)">
     <source 
srcset="[omitted]/images/[unique-image-id]/[seo-friendly-filename].jpeg" 
media="(min-width: 1200px)">
     <source 
srcset="[omitted]/images/[unique-image-id]/[seo-friendly-filename].jpeg" 
media="(min-width: 900px)">
     <source 
srcset="[omitted]/images/[unique-image-id]/[seo-friendly-filename].jpeg" 
media="(min-width: 600px)">
     <source 
srcset="[omitted]/images/[unique-image-id]/[seo-friendly-filename].jpeg" 
media="(min-width: 300px)">
     <source 
srcset="[omitted]/images/[unique-image-id]/[seo-friendly-filename].jpeg" 
media="(min-width: 0px)">
     <!--[if IE 9]></video><![endif]-->
     <img src="[omitted]/images/[unique-image-id]/[seo-friendly-filename].jpeg" 
srcset="[omitted]/images/[unique-image-id]/[seo-friendly-filename].jpeg" 
alt="..." title="..."/>
   </picture>
   <noscript>
     <img src="[omitted]/images/[unique-image-id]/[seo-friendly-filename].jpeg" 
alt="..." title="..."/>
   </noscript>
   ```
   
   We have implemented a component that creates a lot of different sizes based 
on a predefined combination and the image given in the backend (Includes 
cropping, masks, focal points). The user can make a lot of decisions for each 
individual image in our backend.
   
   Because we gave the user that much choice, we want as much control over what 
images are displayed by the browser as possible. AFAIK scrset and sizes only 
give the browser hints as to what you want and the browser decides what it 
really wants to show.
   
   The images are also only generated on the server if they are requested by 
the browser in that specific size, so we didn't want to implement a serverside 
recompression since we would duplicate what MPS already does.
   
   What we want MPS to do (and which it does really well for "regular" img 
tags) is to recompress/change the format (if the browser supports it) of the 
"final" images. Or insert them as base64 into the source code if possible ... 
all the good stuff that already happens in a lot of places. Now, we just need 
it for the sources within the image. ;)
   
   I havn't had the time yet to try your AddUrlValuedAttribute configuration. 
Maybe this already solves our usecase.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to