I have an image uploader, that creates many sizes of the uploaded image :
// Variables
$alpha = $_GET['a'];
$method = $_GET['m'];
$extension = $_GET['e'];
// Configuration
$methods = array
(
'original' => true,
'icon' => array(48, 48),
'small' => array(110, 80),
'medium' => array(360, 0),
'square' => array(186, 186)
);
And here is the output for the image :
// Output
public function output($method)
{
echo '<img src="'.WEB.$method.'/'.$this->alpha().'.'.$this->extension.'" width="" height="" alt="'.stripslashes($this->title).'" title="'.stripslashes($this->title).'"/>';
}
I would like to fill the width and the height of the image, using the $methods arrays, I tried this :
$r_width = $methods[$method][0];
$r_height = $methods[$method][1];
(...) width="'.$this->r_width.'" height="'.$this->r_height.'" (...)
But it doesn’t display anything. What’s wrong ?
If it can help, here is the resizer.php ( http://pastebin.com/gpP4mWSL ), and the image class ( http://pastebin.com/etJARPeY )
Edit : On the view page, here is how I display the image :
<a href="<?php echo WEB.$image->alpha(); ?>/"><?php $image->output('small'); ?></a>
Are you setting, like you have to, the image class parameters r_width and r_height ?
You should have in your code something like that :