I would like to display an image which is not accessible for users (.htaccess denies all).
This is my source:
header('Content-Type: image/png');
$filePath = JPATH_SITE.'/images/powered_by.png';
$image = new Imagick("{$filePath}[0]"); // [0] means "first page"
$image->setImageFormat('png');
echo $image;
exit;
At this moment this code is located on a sub controller called "attachment.php" and is called by opening a modal view (&task=attachment.showAttachment).
Now I'm getting a lot of strange symbols. But why?
Are there Joomla-On-Board-Tools to include this image?
I just mentioned that if I'm opening the file in a new tab everything is fine. The problem only occurs if I want to use it in a modal:
echo "<li> <a href='index.php?option=com_bestia&task=attachment.showAttachment&id=$attachmentid&tmpl=component'
class='modal' rel='{size: {x: 980, y: 500},
closable: true}'>
<i class='icon-search'> </i>
$filename
</a>
</li>";
&tmpl=component
from the URL query in thehref
?