We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 35996
    • 6 Posts
    Hi,

    I have recently set up a website using MODx Revolution (v2.0.6-pl2). I am attempting to make a gallery, using the gallery plugin(v1.2.0pl). I would like it so that you can click a link, which displays the original image, as it was uploaded. Here is the code for my gallery page:

    <div class="ContentHead">[[*longtitle]]</div>
    <p>This page contains galleries of various images I have taken or made. Each has a description, so feel free to browse. Clicking thumbnails will reload the page, and may take some time to load a larger version of the image - but it will get there!</p>
    
    <p>[[!Gallery? &toPlaceholder=`gallery`]] [[!GalleryItem? &imageWidth=`900` &imageHeight=`900`]] [[!GalleryAlbums? &prominentOnly=`0` &limit=`0` &rowTpl=`galAlbumRowTplCustom` &toPlaceholder=`galleries`]]</p>
    
    <div align="center">| [[+galleries]]</div>
    <hr />
    <p><a name="largeImage"></a></p>
    <p> </p>
    
    <p>[[!+galitem.image:notempty=`</p><div class="image"><img class="[[+galitem.imgCls]]" src="[[+galitem.image]]" alt="[[+galitem.name]]" /><br/>[[+galitem.description]]<br />Albums: [[+galitem.albums]] <br />Tags: [[+galitem.tags]]<br/><a href="[[!+galitem.image]]">View original image</a><hr /></div> <p>`]] 
    
    [[!+gallery:notempty=`</p><div ><h1 style="font-size: 20px; font-weight: bold; font-family: Calibri;">[[+gallery.name]]</h1><h2 style="font-size: 18px; font-weight: normal; font-family: Calibri;">[[+gallery.description]]</h2><p> </p><h2 style="font-size: 18px; font-weight: normal; font-family: Calibri;">[[+gallery]]</h2> </div>`]]
    
    <div style="height:600px"><!--This ensures that when a thumb is clicked, the gallery isn't pushed below the footer.--></div>
    

    The code that is causing the problems is:

    <a href="[[!+galitem.image]]">View original image</a>


    which generates the following (example) url:

    http://www.reflectric.com/assets/components/gallery/connector.php?action=web/phpthumb&w=900&h=900&zc=0&far=&q=90&src=http%3A%2F%2Fwww.reflectric.com%2Fassets%2Fcomponents%2Fgallery%2Ffiles%2F3%2F28.bmp
    

    If you follow it (go ahead, try it!) on Internet Explorer (tested on 6 and 9), it shows the image just fine. On every other browser i’ve tested, however, it gives the same as you would get from loading the image in notepad++ or another text editor.

    doing "Right-click Save As" on the image causes the php redirect to be saved, rather than the image, and "Right-click view image" gives the same as the link above.

    Therefore, I am asking either a) is there a way to fix this, or b) is there a way to link to the image directly, instead of going via the php page?

    Thanks for any help you can give,

    Simon
      • 36493
      • 64 Posts
      Hi,

      I think this is the same problem i’m seeing:

      All gallery images are being transferred with MIME type "text/html" not the expected "image/jpeg"

      This is not really a problem when serving images in <img> tags but direct links will not work in most browsers.


      modx 2.1.1pl(trad)
      gallery 1.2.0pl
      apache 2.2.3 (centOS)
      php 5.2.17
        |
        • 28215
        • 4,149 Posts
        Lucy, that might be an issue with the headers. Can you file that as a bug on the tracker?
          shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com