Hi,
I made ruby do the resize based on JS cropper. The image is
cropped and can be written to drive, but I dont know how to
oryginal image and thumbs.
Here is the code:
def my_crop(args={})
x1 = args[:x1].to_i
y1 = args[:y1].to_i
new_width = args[:width].to_i
new_height = args[:height].to_i
with_image do |img|
@data = img.crop(x1, y1, new_width, new_height)
end
@data.write("c:/resized.jpg") # here I gvet the iamge correctly
# this does not work, how to make @data update thumbs?
attachment_options[:thumbnails].each do |suffix, size|
create_or_update_thumbnail(@data, suffix, *size)
end
end
Its based on blog post from http://blog.onmylist.com, but
the oryginal code did not work for me.
Is there a way to update the thumbs?
Cheers,
Tomasz Bak
--
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?hl=en
-~----------~----~----~----~------~----~------~--~---