JPEG doesn't render in module - get raw text instead - Joomla! Forum - community, help and support
when run following code on standalone page, image shows fine. when try run joomla module, jpeg doesn't render , see bunch of gibberish text in place. please advise how fix.
$filename = 'http://164.109.173.40/shipcams/dawncam/fullsize.jpg';
// set maximum height , width
$width = 200;
$height = 200;
// new dimensions
list($width_orig, $height_orig) = getimagesize($filename);
$ratio_orig = $width_orig/$height_orig;
if ($width/$height > $ratio_orig) {
$width = $height*$ratio_orig;
} else {
$height = $width/$ratio_orig;
}
// resample
$image_p = imagecreatetruecolor($width, $height);
$image = imagecreatefromjpeg($filename);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);
// output
imagejpeg($image_p, null, 100);
$filename = 'http://164.109.173.40/shipcams/dawncam/fullsize.jpg';
// set maximum height , width
$width = 200;
$height = 200;
// new dimensions
list($width_orig, $height_orig) = getimagesize($filename);
$ratio_orig = $width_orig/$height_orig;
if ($width/$height > $ratio_orig) {
$width = $height*$ratio_orig;
} else {
$height = $width/$ratio_orig;
}
// resample
$image_p = imagecreatetruecolor($width, $height);
$image = imagecreatefromjpeg($filename);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);
// output
imagejpeg($image_p, null, 100);
you need publish in module designed process code.
try 1 -
http://extensions.joomla.org/component/option,com_mtree/task,viewlink/link_id,25/itemid,35/
it allows add html or javascript module.
try 1 -
http://extensions.joomla.org/component/option,com_mtree/task,viewlink/link_id,25/itemid,35/
it allows add html or javascript module.
Comments
Post a Comment