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"
echo $image;            

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?

enter image description here

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>
  • Could you define what you mean by "strange symbols"? Maybe add these symbols to your question so we know waht they are ;)
    – Lodder
    Aug 14 '15 at 10:53
  • I updated initial question and posted an image.
    – MyFault
    Aug 14 '15 at 11:01
  • Just mentioned that it works fine opening it in a new tab - but I would like to have it in a modal. Any solution for that?
    – MyFault
    Aug 14 '15 at 15:58
  • What happens if you remove &tmpl=component from the URL query in the href?
    – Lodder
    Aug 14 '15 at 16:14
  • In this case there is the toolbar appearing (Joomla Admin-Menu) but the error stays the same.
    – MyFault
    Aug 17 '15 at 7:54


echo $image->getImageBlob();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.