Rails: Paper Trim Syntax

What is the difference between using> or # when trimming your thumb:

Example:

has_attached_file :image, :styles => {:small => "100x100#"} has_attached_file :image, :styles => {:small => "100x100>"} 

How to get a thumb with a maximum height of 100 pixels but a variable width (to maintain aspect ratio)?

thanks

Deb

+4
source share
2 answers

Paperclip uses ImageMagick under covers, here is a link to the full ImageMagick geometry settings (what you put in your little thumbnail descriptions):

http://www.imagemagick.org/script/command-line-processing.php#geometry

It looks like you want: "The height is set, the width is automatically selected to maintain proportions."

 has_attached_file :image, :styles => {:small => "x100"} 
+10
source
 has_attached_file :photo, :styles => { :thumb=> "100x100#", :large => "400x400>" } 
-1
source

Source: https://habr.com/ru/post/1315804/


All Articles