Heim  >  Artikel  >  Backend-Entwicklung  >  adaptive-images的使用方法 php 服务器端 图片处理相关工具

adaptive-images的使用方法 php 服务器端 图片处理相关工具

WBOY
WBOYOriginal
2016-07-28 08:27:561032Durchsuche

对应网页需填写 

nbsp;html>

html>

head>

    meta charset="UTF-8"> 

    title>网页title>

    script>document.cookie='resolution='+Math.max(screen.width,screen.height)+'; path=/';script> //重要

head>

body>

body>

html>

隐藏路由的文件里需要添加 

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ index.php/$1 [L]

//注释部分重要代码

#

#  Options +FollowSymlinks

#  RewriteEngine On

#

#  # Adaptive-Images -----------------------------------------------------------------------------------

#

#  # Add any directories you wish to omit from the Adaptive-Images process on a new line, as follows:

#  # RewriteCond %{REQUEST_URI} !some-directory

#  # RewriteCond %{REQUEST_URI} !another-directory

#

#  RewriteCond %{REQUEST_URI} !assets

#

#  # Send any GIF, JPG, or PNG request that IS NOT stored inside one of the above directories

#  # to adaptive-images.php so we can select appropriately sized versions

#  RewriteRule \.(?:jpe?g|gif|png)$ adaptive-images.php

#

#  # END Adaptive-Images -------------------------------------------------------------------------------

#



这样配置下,手机掉用网页的时候服务器就会根据手机的分辨率输出对应的图片,客户端省流量

附带有对比图片, firefox  数据

以上就介绍了 adaptive-images的使用方法 php 服务器端 图片处理相关工具,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn