8000 GitHub - bmnnit/oxid_webp: Webp support for oxid - image generation on the fly
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Webp support for oxid - image generation on the fly

License

Notifications You must be signed in to change notification settings

bmnnit/oxid_webp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

oxid_webp

Webp support for oxid - image generation on the fly

  1. Install cwebp encoder from https://developers.google.com/speed/webp/docs/cwebp

  2. add the following rules before org. getimg.php rule

    RewriteCond %{HTTP_ACCEPT} image/webp 
    RewriteCond %{REQUEST_FILENAME} (.*)\.(jpe?g|png)$ 
    RewriteCond %1\.png -f [or]
    RewriteCond %1\.jpg -f [or]
    RewriteCond %1\.jpeg -f
    RewriteCond %1\.webp !-f
    RewriteRule (\.jpe?g|\.gif|\.png|\.svg)$ getWebp.php [NC]

    RewriteCond %{HTTP_ACCEPT} image/webp 
    RewriteCond %{REQUEST_FILENAME} (.*)\.(jpe?g|png)$ 
    RewriteCond %1\.webp -f 
    RewriteRule ^(.*)\.(jpg|png)$ $1.webp [L,T=image/webp]
    
    ##org starts here
    RewriteCond %{REQUEST_URI} (\/out\/pictures\/generated\/)
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule (\.jpe?g|\.gif|\.png|\.svg)$ getimg.php [NC]
  1. put getWebp.php into source dir. check encoder path at the begin of file:

    define("CWEBP", "/usr/bin/cwebp");
  2. inspect tail -f source/log/getWebp.log for errors, i had not right to generate pics on certain places

  3. optional: use convert.sh to convert all images, or just wait for it to happen...

Feedback/pull requests welcome

About

Webp support for oxid - image generation on the fly

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0