Skip to content

Commit 0152e96

Browse files
committed
Allow the original or full image to be used as the thumbnail when thumbnailResizeOptions is set to 'original' or 'full' (feature #77)
1 parent a330442 commit 0152e96

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

layouts/shortcodes/gallery.html

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,6 @@
117117
if the EXIF informations contains an orientation value. See issue #22. */}}
118118
{{ $rotated := $original.Filter images.AutoOrient }}
119119

120-
{{/* Create thumbnail, rotate it if needed */}}
121-
{{ $thumbnail := ($rotated.Fit $thumbnailResizeOptions) }}
122-
123-
124120
<div>
125121
{{ $full := "" }}
126122
{{ if $imageResizeOptions }}
@@ -130,6 +126,19 @@
130126
{{/* No need to use the rotated here, the browser will handle care of EXIF orientation */}}
131127
{{ $full = $original }}
132128
{{ end }}
129+
130+
{{ $thumbnail := "" }}
131+
{{ if eq $thumbnailResizeOptions "original" }}
132+
{{/* If thumbnailResizeOptions is set to 'original', use the original (unmodified) image for the thumbnail */}}
133+
{{ $thumbnail = $original }}
134+
{{ else if eq $thumbnailResizeOptions "full" }}
135+
{{/* If thumbnailResizeOptions is set to 'full', use the same image as the lightbox for the thumbnail */}}
136+
{{ $thumbnail = $full }}
137+
{{ else }}
138+
{{/* Create thumbnail, rotate it if needed */}}
139+
{{ $thumbnail = ($rotated.Fit $thumbnailResizeOptions) }}
140+
{{ end }}
141+
133142
<a href="{{ $full.RelPermalink }}"
134143
class="galleryImg"
135144
{{ with $metadata }}

0 commit comments

Comments
 (0)