Download Chapter 1 - Introduction

Transcript
pamscale -linear -xsize=16 -ysize=16 $1 > tmp_logo16.ppm
pnmquant 256 tmp_logo48.ppm > tmp_logo48x48.ppm
pnmquant 256 tmp_logo32.ppm > tmp_logo32x32.ppm
pnmquant 256 tmp_logo16.ppm > tmp_logo16x16.ppm
ppmtowinicon tmp_logo16x16.ppm tmp_logo32x32.ppm
tmp_logo48x48.ppm -output favicon.ico
rm -f tmp_logo*.ppm
Once we have created our script, we need to grant execution permissions on the file.
[bash]# chmod +x /bin/makefavicon
The script is executed at the command prompt with the image to be converted to a favicon listed
as an argument to the script.
[bash]# makefavicon image_file.ppm
To convert a PNG file to a favicon, execute the following command which firstly converts the
file to PNM format, then it can be converted with the script.
[bash]# pngtopnm -mix pic_file.png > file_to_convert.pnm
[bash]# makefavicon file_to_convert.pnm
The icon file now needs to be placed inside the Apache server's document root directory.
[bash]# cp favicon.ico /var/www/html/
The favicon.ico file will be automatically passed to remote web browsers as they connect to your
server (no need to edit html pages), however you are able to manually place inline references to
the favicon if required; this would mainly be done if you wish your pages to use different favicon
sets.
[bash]# vi /var/www/html/index.html
<link rel="icon" href="favicon.ico" type="image/x-icon">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
User Directories