But, I can't re-upload all the files.
Thanks,
Matt
--
Posted via http://www.ruby-forum.com/.
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
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)