I wrote a php script that resizes jpeg images provided by external URL. The script works well on my server with a test page, but it seems that Magento doesn't allow custom php code into product description.
Is there any way to insert that piece of code into description ?
<?php
header('Content-Type: text/html; charset=utf-8');
$url_A = 'http:/...';
$url_B = 'http:/...';
$resizer_URL = 'http:/...';
echo '<a href="'.$url_A.'" target="_blank"><img class="scanA" src="'.$resizer_URL.'?url='.$url_A.'"/></a>
<a href="'.$url_B.'" target="_blank"><img class="scanB" src="'.$resizer_URL.'?url='.$url_B.'"/></a>';
?>
The script code is:
<?php
// The file
$filename = $_GET['url'];
// Content type
header('Content-type: image/jpeg');
// Get new dimensions
list($width, $height) = getimagesize($filename);
$ratio = $height / $width;
$new_width = 580;
$new_height = $new_width * $ratio;
// Resample
$image_p = imagecreatetruecolor($new_width, $new_height);
$image = imagecreatefromjpeg($filename);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
// Output
imagejpeg($image_p, null, 75);
//
imagedestroy($image_p);
imagedestroy($image);
?>
Thanks.