Lines Matching defs:file
25 * If the constructor is not passed a file, a file will need to be supplied using the {@link PHP_ICO::add_image}
26 * function in order to generate an ICO file.
28 * @param bool|string $file Optional. Path to the source image file.
30 * that the source image should be rendered at in the generated ICO file.
34 public function __construct($file = false, $sizes = [])
60 if (false != $file)
61 $this->addImage($file, $sizes);
69 * different sized images in the resulting ICO file. For instance, a small source image can be used for the small
72 * @param string $file Path to the source image file.
74 * source image should be rendered at in the generated ICO file.
78 public function addImage($file, $sizes = [])
80 if (false === ($im = $this->loadImageFile($file)))
128 * Write the ICO file data to a file path.
130 * @param string $file Path to save the ICO file data into.
133 public function saveIco($file)
138 if (false === ($fh = fopen($file, 'w')))
152 * Generate the final ICO data by creating a file header and adding the image data.
266 * Read in the source image file and convert it into a GD image resource.
268 * @param string $file
271 protected function loadImageFile($file)
273 // Run a cheap check to verify that it is an image file.
274 if (false === ($size = getimagesize($file)))
277 if (false === ($file_data = file_get_contents($file)))