0

When I inspect the element, it indicates galleria is using full size image instead of thumbnail.

Example from Galleria documentation is http://galleria.io/docs/getting_started/quick_start/

<div class="galleria">
    <a href="/img/large1.jpg"><img src="/img/thumb1.jpg" data-title="My title" data-description="My description"></a>
    <a href="/img/large2.jpg"><img src="/img/thumb2.jpg" data-title="Another title" data-description="My <em>HTML</em> description"></a>
</div>

My code is

<div class="galleria">
   <a href="http://upload.wikimedia.org/wikipedia/commons/thumb/2/2f/3D_Schildersdoek.JPG/812px-3D_Schildersdoek.JPG">
   <img src="http://upload.wikimedia.org/wikipedia/commons/thumb/2/2f/3D_Schildersdoek.JPG/220px-3D_Schildersdoek.JPG" alt=""/></a>
   <a href="http://upload.wikimedia.org/wikipedia/commons/thumb/0/02/Bitwa_pod_Grunwaldem_Muzeum_Narodowe_05.JPG/800px-Bitwa_pod_Grunwaldem_Muzeum_Narodowe_05.JPG">
   <img src="http://upload.wikimedia.org/wikipedia/commons/thumb/0/02/Bitwa_pod_Grunwaldem_Muzeum_Narodowe_05.JPG/300px-Bitwa_pod_Grunwaldem_Muzeum_Narodowe_05.JPG" alt=""/></a>
</div>

The link to jsfiddle for demo is http://jsfiddle.net/zain_aligent/EAVtM/4/

How can I make galleria use thumbnail images instead of full size images?

zainengineer
  • 13,289
  • 6
  • 38
  • 28

1 Answers1

3

Key point is data-big attribute. Define gallery items like this.

a href="ThumbImage.jpg" and img src="ThumbImage.jpg and data-big="LARGEIMAGE.jpg"

<div class="galleria">
    <a href="ThumbImage.jpg">
        <img src="ThumbImage.jpg" 
            data-big="LargeImage.jpg" 
            data-title="My title" 
            data-description="My description"/>
    </a>
    <a href="ThumbImage.jpg">
        <img src="ThumbImage.jpg" 
            data-big="LargeImage.jpg" 
            data-title="My title" 
            data-description="My description"/>
    </a>
</div>

Try updated version below.

<!DOCTYPE html>
<html>

<head>
    <link  type="text/css"  href="galleria/themes/classic/galleria.classic.css" media="screen" rel="stylesheet"  />
    <script src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
    <script src="galleria/galleria-1.3.6.min.js"></script>
</head>

<body>


<div class="galleria">
    <a href="http://upload.wikimedia.org/wikipedia/commons/thumb/2/2f/3D_Schildersdoek.JPG/220px-3D_Schildersdoek.JPG">
        <img src="http://upload.wikimedia.org/wikipedia/commons/thumb/2/2f/3D_Schildersdoek.JPG/220px-3D_Schildersdoek.JPG" 
            data-big="http://upload.wikimedia.org/wikipedia/commons/thumb/2/2f/3D_Schildersdoek.JPG/812px-3D_Schildersdoek.JPG" 
            data-title="My title" 
            data-description="My description"
            />
    </a>
    <a href="http://upload.wikimedia.org/wikipedia/commons/thumb/0/02/Bitwa_pod_Grunwaldem_Muzeum_Narodowe_05.JPG/300px-Bitwa_pod_Grunwaldem_Muzeum_Narodowe_05.JPG">
        <img src="http://upload.wikimedia.org/wikipedia/commons/thumb/0/02/Bitwa_pod_Grunwaldem_Muzeum_Narodowe_05.JPG/300px-Bitwa_pod_Grunwaldem_Muzeum_Narodowe_05.JPG" 
            data-big="http://upload.wikimedia.org/wikipedia/commons/thumb/0/02/Bitwa_pod_Grunwaldem_Muzeum_Narodowe_05.JPG/800px-Bitwa_pod_Grunwaldem_Muzeum_Narodowe_05.JPG" 
            data-title="Another title" 
            data-description="My <em>HTML</em> description"
        />
    </a>
</div>      



    <script type="text/javascript">
        $( document ).ready(function() {
            Galleria.loadTheme('galleria/themes/classic/galleria.classic.min.js');

            $('.galleria').galleria({
            width: 350,
            height: 315, 
            thumbCrop: "height",
            lightbox: true
            });
            Galleria.run('.galleria');
        });
    </script>

</body>
</html>
khan
  • 4,479
  • 1
  • 15
  • 9
  • Tried in Plunker http://plnkr.co/edit/oB5jF1ydxLmJg0J4wQw1?p=preview Also tried in local. The problem is image is being resized using css/html. If you inspect the element in lets say Chrome. tag src is http://upload.wikimedia.org/wikipedia/commons/thumb/2/2f/3D_Schildersdoek.JPG/812px-3D_Schildersdoek.JPG not http://upload.wikimedia.org/wikipedia/commons/thumb/2/2f/3D_Schildersdoek.JPG/220px-3D_Schildersdoek.JPG – zainengineer Jul 25 '14 at 02:39
  • See updated version. with **data-big** attribute, gallery uses original thumbnail image (not resized/scaled version of big image). I checked it with **Inspect Element With Firebug** in Firefox. – khan Jul 25 '14 at 11:00