Title: Webp Type-Support
Last modified: February 8, 2018

---

# Webp Type-Support

 *  [watschman](https://wordpress.org/support/users/watschman/)
 * (@watschman)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/webp-type-support/)
 * Hello
    I really like your plugin for serving different resolutions of images,
   so that not every mobile has to download a 4k resolution image file. The only,
   let’s say incovenience, I have with this plugin, is the fact that it doesn’t 
   support webp, at least I haven’t found an option for it. Is it possible to add
   support for that, so that browsers who support it (like Chrome) can be served
   with webp instead of a jpg or png? If there is a simple way to achieve that by
   adding .htaccess Rules/Conditions, I’d appreciate it if you were to enlighten
   me how to achieve said webp Support. A Cronjob is already creating webp copies
   of every picture on the wordpress installation, also of those which your plugin
   created.

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [watschman](https://wordpress.org/support/users/watschman/)
 * (@watschman)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/webp-type-support/#post-9952925)
 * Since we are already creating the webp files via a cronjob, we simply modified
   your “adaptive-images-script.php” and added to you function “adaptive_images_script_send_image”
   the following lines as a temporary solution:
 *     ```
       if(strpos($_SERVER["HTTP_ACCEPT"], "image/webp") !== false){
         $tmp = preg_replace("/\.(jpe?g|png)$/", ".webp", $filename);
         if(file_exists($tmp)){
           $filename = $tmp;
           $extension = 'webp';
         }
         if(in_array($extension, array('png', 'gif', 'jpeg', 'webp'))){
         ...
       }
       ```
   
 *  Plugin Author [Takis Bouyouris](https://wordpress.org/support/users/nevma/)
 * (@nevma)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/webp-type-support/#post-9973386)
 * Hello, my friend,
 * Webp is indeed a very important chapter in image compression, but, as it is not
   uniformly supported by all modern browsers, we have chosen not to add an extra
   level of complexity in order to handle them in a special way.
 * Your proposed solution is very simple and very smart indeed! However, it applies
   to your particular setup and I cannot see how it could be generalised for everyone.
   In addition it does add an obscurity factor because it also renames the images
   from `.jpg` to `.webp`.
 * I guess we should wait until Webp is supported by everyone and incorporate it
   into the Adaptive Images plugin in the same way as the other supported formats.
 * Thank you very much for chipping in your ideas!
 * Cheers,
    Takis

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Webp Type-Support’ is closed to new replies.

 * ![](https://ps.w.org/adaptive-images/assets/icon-256x256.png?rev=1138642)
 * [Adaptive Images for WordPress](https://wordpress.org/plugins/adaptive-images/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/adaptive-images/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/adaptive-images/)
 * [Active Topics](https://wordpress.org/support/plugin/adaptive-images/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/adaptive-images/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/adaptive-images/reviews/)

## Tags

 * [feature](https://wordpress.org/support/topic-tag/feature/)
 * [request](https://wordpress.org/support/topic-tag/request/)

 * 2 replies
 * 2 participants
 * Last reply from: [Takis Bouyouris](https://wordpress.org/support/users/nevma/)
 * Last activity: [8 years, 3 months ago](https://wordpress.org/support/topic/webp-type-support/#post-9973386)
 * Status: not resolved