Re-generate thumbnails?

8 views
Skip to first unread message

photo matt

unread,
Jan 22, 2008, 11:34:12 PM1/22/08
to rubyonra...@googlegroups.com
Has anybody figured out a way to force attachment_fu to regenerate
thumbnails? I had some major issues with mini_magick not figuring out
the correct image sizes, and I'd like to re-try with rmagick.

But, I can't re-upload all the files.

Thanks,

Matt
--
Posted via http://www.ruby-forum.com/.

Jodi Showers

unread,
Jan 23, 2008, 9:07:59 AM1/23/08
to rubyonra...@googlegroups.com
PH,

On 22-Jan-08, at 11:34 PM, photo matt wrote:

>
> Has anybody figured out a way to force attachment_fu to regenerate
> thumbnails? I had some major issues with mini_magick not figuring out
> the correct image sizes, and I'd like to re-try with rmagick.
>
> But, I can't re-upload all the files.
>
> Thanks,
>
> Matt
>

I came across this post recently - as I'll need to do the same in the
near term

http://www.razorproxy.com/index.php?
q=aHR0cDovL2JlYXN0LmNhYm9vLnNlL2ZvcnVtcy8yL3RvcGljcy80NjIzP3BhZ2U9MSNwb3
N0cy03ODMy

can you let me now if it works out for you?

thanx,
Jodi

photo matt

unread,
Jan 27, 2008, 8:51:23 AM1/27/08
to rubyonra...@googlegroups.com
Jodi,

I had seen that link before posting, and I'm not sure why it didn't work
for me the first time around. Of more important info possibly is that
my server had ImageMagick 6.2.4, and it was (randomly) reporting widths
and heights of null, and wasn't actually resizing the thumbnails.
Upgrading to 6.3.8 fixed this problem. Anyways, here's my script which
I ran that fixed the data....

Photo.find(:all, :conditions=>["width IS NULL and height IS NULL and
parent_id IS NULL"]).each do |p|
puts "Fixing #{p.filename}"
temp_file = p.create_temp_file
image = MiniMagick::Image.from_blob(temp_file.path)
p.width = image[:width]
p.height = image[:height]
p.save
p.attachment_options[:thumbnails].each { |suffix, size|
p.create_or_update_thumbnail(temp_file, suffix, *size)

danny thyui

unread,
Aug 18, 2013, 10:09:43 PM8/18/13
to rubyonra...@googlegroups.com
i always do such the work and i feel some professional software might be
able to do us a favor .Recently Im dealing thumbnail generation with vb
,it maybe another sulotion here .BTW, the info above give me more
choice, I got interested in make this out in different ways.
http://www.rasteredge.com/how-to/vb-net-imaging/thumbnail-creating/

Jordon Bedwell

unread,
Aug 18, 2013, 10:15:46 PM8/18/13
to rubyonra...@googlegroups.com
On Sun, Aug 18, 2013 at 9:09 PM, danny thyui <li...@ruby-forum.com> wrote:
> i always do such the work and i feel some professional software might be
> able to do us a favor .Recently Im dealing thumbnail generation with vb
> ,it maybe another sulotion here .BTW, the info above give me more
> choice, I got interested in make this out in different ways.
> http://www.rasteredge.com/how-to/vb-net-imaging/thumbnail-creating/

grep /(ruby|rails)/i then grok
Reply all
Reply to author
Forward
0 new messages