Im using paperclip for video uploading in my rails application.But i dont know how to get thumbnail image. Can anyone help me to achieve and give reference links as well..
You can use
gem 'paperclip-av-transcoder'
for generating thumbnails
link
Related
I use gem "ckeditor" for a textarea, but it just only upload image, i want to upload video from desktop/link online. How can I do?
You can upload a video by using the "Link" option in Ckeditor.
See the image here:
I am trying to generate a video from multiple images using RMagick. The images are saved into ActiveStorage and what I am trying to do is
images = Magick::ImageList.new(*["#{url_for(Post.first.image)}","
{url_for(Post.last.image)}"])
images.write("new_video.avi")
but that way seems not really working so basically all I want is calling images from activestorage and display them like a video. Any ideas?
Rmagick doesn't support video formats. You can generate a gif using the ImageList class with some time between each image. Here you can find a lot of good examples.
Alternatively if you really need an AVI file you can switch to other libraries for example ffmpeg. Example here
I am developing a Rails application and I want to upload a picture directly from my browser using Cloudinary.
I followed all steps from the Cloudinary page and ended up with a box and a question mark after I "uploaded" it, no picture at all. Any ideas what might be the problem?
I am not sure what you have used. But you should use carrierwave with cloudinary. Cloudinary having some complex way to handle display and save image if you don't use carrierwave.
But carreirwave provide simpler way to achieve uploading and display image.
Without using carrierwave
Using carrierwave in compbination
You should try the sample project and then check the differences:
https://github.com/cloudinary/cloudinary_gem/tree/master/samples/photo_album
I'm trying to figure out the best way to upload a camera image from a PhoneGap app to a Rails 3 app that has Carrierwave on it. My thoughts so far:
Option 1) Use phonegap filetransfer functionality to upload to a temp folder on S3 then assign the URL to the remote_avatar_url for my carrierwave field. Then carrierwave does all the work for me in terms of grabbing the image, resizing, cropping, etc. Carrierwave will then send the files back over to S3 where they will be stored in the right places.
Option 2) Use phonegap filetransfer functionality to upload directly to my rails server then let carrierwave do the work from here. This seems more efficient, but I don't know how to assign an image that was posted to a rails api controller to Carrierwave so that it can do its thing. Any ideas assuming this is the best way to handle?
Thanks!
You can send the image as Base64/encode and than parse it on the CarrierWave side. Take a look at http://ograycoding.wordpress.com/2012/07/03/api-upload-with-carrierwave/
How do I upload images and zip files in RoR? I am a newbie. So please help.
Give me both the view and the controller code example.
Thanks in advance.
Nav,
Try the paperclip plugin, you can read about it here http://www.thoughtbot.com/projects/paperclip
We prefer CarrierWave for image uploads in Rails. Very easy to integrate and very modular.
The following post describes a solution for image uploading using CarrierWave while image transformations are done seamlessly in the cloud. Uploaded images are stored in the cloud and delivered through a CDN.
No need to install RMagick, MiniMagick and ImageMagick.
http://cloudinary.com/blog/ruby_on_rails_image_uploads_with_carrierwave_and_cloudinary
suggest checking out the Railscast for paperclip.
ImageMagick is also pretty cool
I would recommend paperclip, and the patch that allows you to store the content in the database instead of the file system
http://patshaughnessy.net/paperclip-database-storage
the link has the view and controller examples that you are looking for
I prefer carrierwave is better to upload images easily.
Here's github page , and railscasts page for quick start.
One option is attachment_fu. It allows you to save your uploaded file to the filesystem, database, or Amazon S3. It also allows you to select which image processor is used, such as RMagick or Minimagick.
The link provides better code than I could here.