Koenig, насчет вращения не подумал, но и там можно их устанавливать отдельно внутри класса. А про ресайз уже говорил.
Вот пример вобщем
<?php
class Image {
private $height;
private $width;
public function __construct($path)
{
# code...
$this->width = imagesx($image);
$this->height = imagesy($image);
}
public function set_width($width) {
$this->width = $width;
// Resize ...
}
public function set_height($height) {
$this->height = $height;
// Resize ...
}
public function rotate() {
// Rotate ..
$this->width = imagesx($image);
$this->height = imagesy($image);
}
public function get_width() {
return $this->width;
}
public function get_height() {
return $this->height;
}
}Ну а раз для каждого изображения один объект, то тогда всё понятно.
Но всё равно в деструкторе не вижу смысла. Всё и так удалится.
А если нужно освободить память, то просто присваивай ссылке на объект значение null