I have an app hosted on heroku that users can upload images to. If
landscape, I want to resize_to_fill, otherwise resize_to_fit (using
carrierwave).
This works perfectly in development, however on heroku it doesn't.
The logs report that the filename cannot be found. I suspect it has
something to with the temporary filename that is stored in /tmp/
uploads not being found.
I'm hoping someone can shed some light on the best way to do what I'm
trying to do on heroku and s3.
Thanks,
Rob
In the uploader I've put in :
def cache_dir
"#{Rails.root}/tmp/uploads"
end
and the landscape checking code is :
def landscape?(new_file)
image = MiniMagick::Image.open(new_file.path) <--- I think this is
where the problem lies...
image[:width] > image[:height]
end
and the versions are :
version :thumb, :if => :landscape? do
process :resize_to_fill => [210, 297]
end
version :thumb, :unless => :landscape? do
process :resize_to_fit => [210, 297]
end
--
You received this message because you are subscribed to the Google Groups "Ruby
or Rails Oceania" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rails-oceania?hl=en.