hello, I have recently discovered the file column plugin. so far I have got my images uploading and displaying just fine. However, I can''t seem to display two different versions of my image. I have a thumbnail and a medium size specified in my model. class Image < ActiveRecord::Base file_column :image, :magick => { :versions => { "thumb" => "100x100", "medium" => "640x480>" } } end from my list action I am calling to a thumbnail view. <%= image_tag url_for_file_column(image, "image", "thumb" ), :alt => image.comment %> this seems to give me a nice thumbnail view however the dimensions of the image are set to 100 x 75. Here is the code that the above tag is outputting <img alt="this is good" src="/image/image/11/thumb/10.jpg?1156677228" /> in my show action I have the following code outputting the image <%= image_tag url_for_file_column(image, "image", "medium" ), :alt => image.comment %> once again the image dimensions are set to 100 x 75. Where is rails getting this value from? And why does it not differentiate between the two versions of image I have specified? thanks in advance for any help. Stewart -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
On 27 Aug 2006, at 14:15, Stewart Matheson wrote:> > hello, > > I have recently discovered the file column plugin. so far I have > got my > images uploading and displaying just fine. However, I can''t seem to > display two different versions of my image. I have a thumbnail and a > medium size specified in my model. > > class Image < ActiveRecord::Base > file_column :image, :magick => { > :versions => { "thumb" => "100x100", "medium" => "640x480>" } > } > end > > from my list action I am calling to a thumbnail view. > > <%= image_tag url_for_file_column(image, "image", "thumb" ), :alt => > image.comment %> > > this seems to give me a nice thumbnail view however the dimensions of > the image are set to 100 x 75. Here is the code that the above tag is > outputting > > <img alt="this is good" src="/image/image/11/thumb/10.jpg? > 1156677228" /> > > in my show action I have the following code outputting the image > > <%= image_tag url_for_file_column(image, "image", "medium" ), :alt => > image.comment %> > > once again the image dimensions are set to 100 x 75. Where is rails > getting this value from? And why does it not differentiate between > the > two versions of image I have specified? > > thanks in advance for any help.I believe (correct me if I''m wrong) that the 100x100 is the maximum x/ y values and the aspect ratio of the image uploaded is fixed to the uploaded image. So if you upload an image with a resolution of 200 x 100, the file_column plugin will resize it to 100 x 50. I would check your original image that you''re uploading. Alastair ------ Alastair Moore Standards compliant web development with Ruby On Rails, PHP and ASP www.kozmo.co.uk 07738 399038 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Alastair Moore wrote:> On 27 Aug 2006, at 14:15, Stewart Matheson wrote: > >> file_column :image, :magick => { >> the image are set to 100 x 75. Here is the code that the above tag is >> once again the image dimensions are set to 100 x 75. Where is rails >> getting this value from? And why does it not differentiate between >> the >> two versions of image I have specified? >> >> thanks in advance for any help. > > I believe (correct me if I''m wrong) that the 100x100 is the maximum x/ > y values and the aspect ratio of the image uploaded is fixed to the > uploaded image. So if you upload an image with a resolution of 200 x > 100, the file_column plugin will resize it to 100 x 50. I would check > your original image that you''re uploading. > > Alastair > > > ------ > Alastair Moore > Standards compliant web development with Ruby On Rails, PHP and ASP > www.kozmo.co.uk > 07738 399038thanks so much Alastair, thats exacley whats happening! -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---