Watermark now on east. New method for medium-sized images
This commit is contained in:
parent
37bf1d8589
commit
c23cfbbba2
2 changed files with 17 additions and 8 deletions
|
|
@ -162,11 +162,20 @@ class Screenshot < ApplicationRecord
|
||||||
#Digest::MD5.base64digest(Net::HTTP.get(URI(url)))
|
#Digest::MD5.base64digest(Net::HTTP.get(URI(url)))
|
||||||
end
|
end
|
||||||
|
|
||||||
# Returns the URL that links to a full-size screenshot image with a watermark
|
# Returns the image variant that links to a full-size screenshot image with a watermark
|
||||||
def large_watermarked
|
def medium_image
|
||||||
if self.image.attached?
|
if self.image.attached?
|
||||||
self.image.variant(
|
self.image.variant(
|
||||||
gravity: 'SouthEast',
|
resize_to_limit: [670, 600]
|
||||||
|
).processed
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# Returns the image variant that links to a medium-size screenshot for the details page
|
||||||
|
def large_image_watermarked
|
||||||
|
if self.image.attached?
|
||||||
|
self.image.variant(
|
||||||
|
gravity: 'East',
|
||||||
draw: 'image Over 0,0 0,0 "public/logo/watermark.png"'
|
draw: 'image Over 0,0 0,0 "public/logo/watermark.png"'
|
||||||
).processed
|
).processed
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -19,9 +19,9 @@
|
||||||
.margin-bottom-3
|
.margin-bottom-3
|
||||||
|
|
||||||
/ TODO: de-duplicate
|
/ TODO: de-duplicate
|
||||||
a href =url_for(screenshot.large_watermarked) rel='fancybox-thumb' title=screenshot.caption data-fancybox='gallery' data-caption=screenshot_caption(screenshot)
|
a href =url_for(screenshot.large_image_watermarked) rel='fancybox-thumb' title=screenshot.caption data-fancybox='gallery' data-caption=screenshot_caption(screenshot)
|
||||||
.image-with-zoom-icon
|
.image-with-zoom-icon
|
||||||
= image_tag(url_for(screenshot.image), alt: screenshot.caption, class: 'thumbnail')
|
= image_tag(url_for(screenshot.medium_image), alt: screenshot.caption, class: 'thumbnail')
|
||||||
|
|
||||||
.magnifying-glass-icon
|
.magnifying-glass-icon
|
||||||
i.fa.fa-search
|
i.fa.fa-search
|
||||||
|
|
@ -34,12 +34,12 @@
|
||||||
|
|
||||||
/ Display further screenshots as smaller images
|
/ Display further screenshots as smaller images
|
||||||
- else
|
- else
|
||||||
.small-6.medium-6.cell
|
.small-12.medium-6.cell
|
||||||
.margin-bottom-3
|
.margin-bottom-3
|
||||||
|
|
||||||
a href =url_for(screenshot.large_watermarked) rel='fancybox-thumb' title=screenshot.caption data-fancybox='gallery' data-caption=screenshot_caption(screenshot)
|
a href =url_for(screenshot.large_image_watermarked) rel='fancybox-thumb' title=screenshot.caption data-fancybox='gallery' data-caption=screenshot_caption(screenshot)
|
||||||
.image-with-zoom-icon
|
.image-with-zoom-icon
|
||||||
= image_tag(url_for(screenshot.image), alt: screenshot.caption, class: 'thumbnail')
|
= image_tag(url_for(screenshot.medium_image), alt: screenshot.caption, class: 'thumbnail')
|
||||||
|
|
||||||
.magnifying-glass-icon
|
.magnifying-glass-icon
|
||||||
i.fa.fa-search
|
i.fa.fa-search
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue