From f169462ef50b0dd1635846b86e5886ca826745fa Mon Sep 17 00:00:00 2001
From: "real3t@gmail.com" <>
Date: Thu, 11 Jun 2015 19:46:30 +0000
Subject: [PATCH] =?UTF-8?q?Favicon=20et=20Apple-Touch-Icon=20=C3=A0=20la?=
 =?UTF-8?q?=20mode=203.0=20(cf=20[70268])?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Au passage, la question "Regle htacces a ajouter à la main, à moins qu'on ne la mette par défaut ?" se pose toujours pour SPIP 3.1
---
 apple-touch-icon.png.html | 25 +++++++++++++++++--------
 favicon.ico.html          | 13 +++++++++----
 2 files changed, 26 insertions(+), 12 deletions(-)

diff --git a/apple-touch-icon.png.html b/apple-touch-icon.png.html
index 36408a50..6e6d9777 100644
--- a/apple-touch-icon.png.html
+++ b/apple-touch-icon.png.html
@@ -1,8 +1,17 @@
-[(#HTTP_HEADER{Content-Type: image/png}
-)][(#REM) Icones pour iOS : http://developer.apple.com/library/IOS/#documentation/AppleApplications/Reference/SafariWebContent/ConfiguringWebApplications/ConfiguringWebApplications.html
-][(#CHEMIN{images/apple-touch-icon.png}|sinon{[(#LOGO_SITE_SPIP_NORMAL
-		|image_passe_partout{114,114}
-		|image_format{png}
-		|image_recadre{114,114,center,transparent}
-		|extraire_attribut{src}
-)]}|sinon{#CHEMIN{images/apple-touch-icon-soyezcreateurs.png}}|spip_file_get_contents)]
\ No newline at end of file
+#HTTP_HEADER{Content-Type: image/png}
+#HTTP_HEADER{Content-Transfer-Encoding: binary}
+<?php
+/*
+Icones pour iOS : http://developer.apple.com/library/IOS/#documentation/AppleApplications/Reference/SafariWebContent/ConfiguringWebApplications/ConfiguringWebApplications.html
+Dans le .htaccess :
+RewriteRule ^apple-touch-icon(-(\d+x\d+))?(-precomposed)?[.]png$      spip.php?page=apple-touch-icon.png&size=$2 [QSA,L]
+*/
+$file="[(#CHEMIN{images/apple-touch-icon[-(#ENV{size,''})].png}|sinon{[(#LOGO_SITE_SPIP_NORMAL
+		|image_passe_partout{[(#ENV{size,57}|intval)],[(#ENV{size,57}|intval)]}
+		|image_recadre{[(#ENV{size,57}|intval)],[(#ENV{size,57}|intval)],center,transparent}
+		|image_aplatir{png,#ffffff}|extraire_attribut{src}
+		)]}|sinon{#CHEMIN{images/apple-touch-icon-soyezcreateurs.png}})]";
+if ($cl = filesize($file=preg_replace(',[?].*$,','',$file)))
+	header("Content-Length: ". $cl);
+
+readfile($file);
\ No newline at end of file
diff --git a/favicon.ico.html b/favicon.ico.html
index f51109b7..0b14e759 100644
--- a/favicon.ico.html
+++ b/favicon.ico.html
@@ -1,7 +1,12 @@
-[(#HTTP_HEADER{Content-Type: image/x-icon}
-)][(#CHEMIN{images/favicon.ico}|sinon{[(#LOGO_SITE_SPIP_NORMAL
+#HTTP_HEADER{Content-Type: image/x-icon}
+#HTTP_HEADER{Content-Transfer-Encoding: binary}
+<?php
+$file="[(#CHEMIN{images/favicon.ico}|sinon{[(#LOGO_SITE_SPIP_NORMAL
 		|image_passe_partout{32,32}
 		|image_recadre{32,32,center}
 		|image_format{ico}|extraire_attribut{src}
-)]}|sinon{#CHEMIN{images/soyezcreateurs.ico}}
-|spip_file_get_contents)]
\ No newline at end of file
+)]}|sinon{#CHEMIN{images/soyezcreateurs.ico}})]";
+if ($cl = filesize($file=preg_replace(',[?].*$,','',$file)))
+	header("Content-Length: ". $cl);
+
+readfile($file);
\ No newline at end of file
-- 
GitLab