Hi All, My application is using paperclip and its working fine without any problems, I am able to generate the thumb images and big images from actual uploaded images. There are many images already uploaded by the users. Now I want to create small images from the original uploaded image. For the newly uploaded images its working fine but how can I do the same for already uploaded image?? if photo.get_photo(:small).nil? end what the code I can write inside or any other way I can do the same?? Thanks, Ramu. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Apr 4, 2010, at 10:13 PM, bramu.ss-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:> > Hi All, > > My application is using paperclip and its working fine without any > problems, I am able to generate the thumb images and big images from > actual uploaded images. There are many images already uploaded by the > users. Now I want to create small images from the original uploaded > image. For the newly uploaded images its working fine but how can I do > the same for already uploaded image?? > > if photo.get_photo(:small).nil? > > end > > what the code I can write inside or any other way I can do the same?? > > Thanks, > Ramu.This might get you goingL File.open(existing_file_name, "rb") {|file| self.image = file } HTH -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Rake paperclip:reprocess Sent from my iPhone On 05.04.2010, at 9:41, steve ross <cwdinfo-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Apr 4, 2010, at 10:13 PM, bramu.ss-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote: >> >> Hi All, >> >> My application is using paperclip and its working fine without any >> problems, I am able to generate the thumb images and big images from >> actual uploaded images. There are many images already uploaded by the >> users. Now I want to create small images from the original uploaded >> image. For the newly uploaded images its working fine but how can I >> do >> the same for already uploaded image?? >> >> if photo.get_photo(:small).nil? >> >> end >> >> what the code I can write inside or any other way I can do the same?? >> >> Thanks, >> Ramu. > > > This might get you goingL > > File.open(existing_file_name, "rb") {|file| > self.image = file > } > > HTH > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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?hl=en > . >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
May be you can try to check url for you thumbnails for example: # has_att.. :image if photo.image.blank? or photo.image.url(:small).blank? # end On 5 апр, 08:13, "bramu...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <bramu...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi All, > > My application is using paperclip and its working fine without any > problems, I am able to generate the thumb images and big images from > actual uploaded images. There are many images already uploaded by the > users. Now I want to create small images from the original uploaded > image. For the newly uploaded images its working fine but how can I do > the same for already uploaded image?? > > if photo.get_photo(:small).nil? > > end > > what the code I can write inside or any other way I can do the same?? > > Thanks, > Ramu.-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
You can do it by just writing a rake task which takes in the already uploaded images one by one and then reprocess them and upload them again. This will take care of the small and other styles of the images. Hope this helps. --Hansraj On Apr 5, 10:13 am, "bramu...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <bramu...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi All, > > My application is using paperclip and its working fine without any > problems, I am able to generate the thumb images and big images from > actual uploaded images. There are many images already uploaded by the > users. Now I want to create small images from the original uploaded > image. For the newly uploaded images its working fine but how can I do > the same for already uploaded image?? > > if photo.get_photo(:small).nil? > > end > > what the code I can write inside or any other way I can do the same?? > > Thanks, > Ramu.-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
bramu.ss-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2010-Apr-06 09:29 UTC
Re: paperclip question
Thanks all for your suggestions... Hansraj, can you please post the code snippet which does that... On Apr 5, 12:52 pm, hansraj <hansrajp...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> You can do it by just writing a rake task which takes in the already > uploaded images one by one > and then reprocess them and upload them again. > This will take care of the small and other styles of the images. > > Hope this helps. > > --Hansraj > > On Apr 5, 10:13 am, "bramu...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <bramu...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Hi All, > > > My application is using paperclip and its working fine without any > > problems, I am able to generate the thumb images and big images from > > actual uploaded images. There are many images already uploaded by the > > users. Now I want to create small images from the original uploaded > > image. For the newly uploaded images its working fine but how can I do > > the same for already uploaded image?? > > > if photo.get_photo(:small).nil? > > > end > > > what the code I can write inside or any other way I can do the same?? > > > Thanks, > > Ramu.-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.