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);

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.





Comments

Popular posts from this blog

DHT11 Time out error using v0.4.1library

Sketch upload fails with Java error (___REMOVE___/bin/avrdude)!

Arduino Uno + KTY81/210 temperature sensor