ruby on rails - Paperclip not sizing correctly -


I am using a paperclip for my app and the images are not consistent with the sizes that I set them. I am using paperclip and ramagic and image magic is established. When I Convert

  C: \ Program Files \ ImageMagick-6.8.9-Q16 \ convert.exe C: \ Windows \ System32 \ Convert. Exe   

development.rb

  paperclip. Option [: command_path] = "C: / Program Files / ImageMagic-6.8.9-Q16 / Convert exe"   

Gemfile

  Mani paperclip 'Gem' rmagick ',' ~ & gt; 2.13.2 ',: platform = & gt; : Ruby   

User.rb

  is_teated_file: avatar, genres: {Medium: '210x260'; Large: "300x300" gt; "Thumbs:" 100x100> "}, Default_url:" /assets/default.png "Validities_itity_cent_type: avatar: content_type => [" image / jpg "," image / jpeg "," image / png "," image / gif "]   

view

  & lt;% = Image_tag @ user.avatar (** style **)%>   < p> I am testing it on two different images at different sizes, A (basically 960x688) and B (basically 160x160)  

A (: thumbs up)

B (: medium) becomes 160x160

A (Medium) gets 210x151

/ P>

B (increases) 300x300

I have tried to upload the image again after resizing, but I have received the same result. So, is there a problem in the image of different sizes of paper clips or whether my code Is there a problem in the?

You need to change your trailing character after the dimension of your size, Therefore, in your case you need

  medium: 210x260 #   

document Psht the states

  retaining resize the default behavior of the image aspect ratio (ie: European version of the 300 E will be 200 A 150 image? 100). Some commonly used options are: tracing of '#', thumbnails will be centrally stopped, ensure the requested dimensions. Following '& gt;', the thumbnail will only be modified if it is currently enlarging the requested dimensions (i.e.: thumb 80 for the 80. The original image will be unchanged)   

For your current images you can do this in the console

  Image .all.each {| S | S.image.reprocess! }   

After which any other images you upload will not need to be reprocessed and will be resized as you need

Hopefully

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -