Forum: Ruby on Rails My crop - how to update thumbnails

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Tom B. (Guest)
on 2008-11-11 01:38
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)

    @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)

Its based on blog post from, but
the oryginal code did not work for me.

Is there a way to update the thumbs?

Tomasz Bak
This topic is locked and can not be replied to.