mirror of
https://github.com/danbee/my-images
synced 2025-03-04 08:49:05 +00:00
Render jpeg only if the input is jpeg
This commit is contained in:
parent
9139df42c8
commit
e13dfe89fc
@ -1,5 +1,9 @@
|
|||||||
module ImageHelper
|
module ImageHelper
|
||||||
def image_thumb(image, size)
|
def image_thumb(image, size)
|
||||||
image.thumb(size).encode("jpg", "-quality 90")
|
if image.format == "jpeg"
|
||||||
|
image.thumb(size).encode("jpg", "-quality 90")
|
||||||
|
else
|
||||||
|
image.thumb(size)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user