I''m running file_column 0.3.1, and having a few problems... which are: - Uploading a 378x567 jpg, and using :magick => {:geometry => "100x100" }, my image ends up being 67x100 ? Is there a way to "force" the image to be the size you specify ? - My view has a drop-down of sizes, and I''m trying to pass in this size into :magick => {:geometry => SIZE_HERE}. I''ve tried replacing SIZE_HERE with self.size, replacing it with a @size instance variable in a "before_create"... etc, etc... ... but I can''t seem to get the proper value included in this hash prior to it running. Any insight into the above would be great, Thank you ! =Dylan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060221/bb8a57f2/attachment.html
Dylan, Although you''re setting 100x100, the image proportions are being constrained which is a good thing believe it or not. If the Proportions weren''t then the image would come out looking squished and stretched. I don''t believe anything exists that would be able to programmatically change the image size without constraint to the proportions and still have it looking good but I could be wrong. If their is, the best you could hope for is that the image would be changed to 67X100 but incorporated into another image that was 100X100. The result would be white (or what ever color you chose) on either side. Sorry, it may not be the answer you were looking for but at least your on your way. Scott. Dylan Stamat wrote:> I''m running file_column 0.3.1, and having a few problems... which are: > > > - Uploading a 378x567 jpg, and using :magick => {:geometry => > "100x100" }, my image ends up being 67x100 ? > Is there a way to "force" the image to be the size you specify ? > > - My view has a drop-down of sizes, and I''m trying to pass in this > size into :magick => {:geometry => SIZE_HERE}. > I''ve tried replacing SIZE_HERE with self.size, replacing it with a > @size instance variable in a "before_create"... etc, etc... > ... but I can''t seem to get the proper value included in this hash > prior to it running. > > > Any insight into the above would be great, > Thank you ! > => Dylan-- Posted via http://www.ruby-forum.com/.
Gotcha... thanks for the explanation Scott. This definitely makes sense, and actually makes my work a little bit easier. Thanks again ! On 2/21/06, Scott <scottcarlhughes@gmail.com> wrote:> > Dylan, > Although you''re setting 100x100, the image proportions are being > constrained which is a good thing believe it or not. If the Proportions > weren''t then the image would come out looking squished and stretched. I > don''t believe anything exists that would be able to programmatically > change the image size without constraint to the proportions and still > have it looking good but I could be wrong. If their is, the best you > could hope for is that the image would be changed to 67X100 but > incorporated into another image that was 100X100. The result would be > white (or what ever color you chose) on either side. > > Sorry, it may not be the answer you were looking for but at least your > on your way. > > Scott. > > Dylan Stamat wrote: > > I''m running file_column 0.3.1, and having a few problems... which are: > > > > > > - Uploading a 378x567 jpg, and using :magick => {:geometry => > > "100x100" }, my image ends up being 67x100 ? > > Is there a way to "force" the image to be the size you specify ? > > > > - My view has a drop-down of sizes, and I''m trying to pass in this > > size into :magick => {:geometry => SIZE_HERE}. > > I''ve tried replacing SIZE_HERE with self.size, replacing it with a > > @size instance variable in a "before_create"... etc, etc... > > ... but I can''t seem to get the proper value included in this hash > > prior to it running. > > > > > > Any insight into the above would be great, > > Thank you ! > > => > Dylan > > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060221/cf40dfcc/attachment.html
i believe you can specify a forced sized by appending a ''!'' such as :magick => {:geometry => "100x100!" } if you look in the rmagick docs under ''geometry strings'' there are all sorts of extras like ''<'' to resize if it is smaller than the given size. -felix Dylan Stamat wrote:> I''m running file_column 0.3.1, and having a few problems... which are: > > > - Uploading a 378x567 jpg, and using :magick => {:geometry => > "100x100" }, my image ends up being 67x100 ? > Is there a way to "force" the image to be the size you specify ? > > - My view has a drop-down of sizes, and I''m trying to pass in this > size into :magick => {:geometry => SIZE_HERE}. > I''ve tried replacing SIZE_HERE with self.size, replacing it with a > @size instance variable in a "before_create"... etc, etc... > ... but I can''t seem to get the proper value included in this hash > prior to it running. > > > Any insight into the above would be great, > Thank you ! > => Dylan > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails
ahh... brilliant, thanks Felix. the RMagick docs are huuuuge, and I probably skipped right over this :( there are about 100 instance methods for Image itself... and they are all actually very applicable :) On 2/21/06, Felix McCoey <felix.mccoey@sensorynetworks.com> wrote:> > i believe you can specify a forced sized by appending a ''!'' such as > :magick => {:geometry => "100x100!" } > > if you look in the rmagick docs under ''geometry strings'' there are all > sorts of extras like ''<'' to resize if it is smaller than the given size. > > -felix > > Dylan Stamat wrote: > > I''m running file_column 0.3.1, and having a few problems... which are: > > > > > > - Uploading a 378x567 jpg, and using :magick => {:geometry => > > "100x100" }, my image ends up being 67x100 ? > > Is there a way to "force" the image to be the size you specify ? > > > > - My view has a drop-down of sizes, and I''m trying to pass in this > > size into :magick => {:geometry => SIZE_HERE}. > > I''ve tried replacing SIZE_HERE with self.size, replacing it with a > > @size instance variable in a "before_create"... etc, etc... > > ... but I can''t seem to get the proper value included in this hash > > prior to it running. > > > > > > Any insight into the above would be great, > > Thank you ! > > => > Dylan > > > > > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060222/ef84faaa/attachment.html