image_gd_open

Хочешь помочь с переводом? Это очень просто и быстро. Лишь зарегистрируйся, и можешь тут же начать переводить.

includes/image.gd.inc, строка 183

Версии
5 – 6
image_gd_open($file, $extension)

GD helper function to create an image resource from a file.

Параметры

$file A string file path where the iamge should be saved.

$extension A string containing one of the following extensions: gif, jpg, jpeg, png.

Возвращаемое значение

An image resource, or FALSE on error.

Связанные темы

▾ 3 функции вызывают image_gd_open()

image_gd_crop in includes/image.gd.inc
Обрезает изображение используя набор инструментов GD.
image_gd_resize in includes/image.gd.inc
Scale an image to the specified size using GD.
image_gd_rotate in includes/image.gd.inc
Поворачивает изображение на заданное число градусов.

Код

<?php
function image_gd_open($file, $extension) {
  $extension = str_replace('jpg', 'jpeg', $extension);
  $open_func = 'imageCreateFrom'. $extension;
  if (!function_exists($open_func)) {
    return FALSE;
  }
  return $open_func($file);
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии

Вход в систему