Find resolution of an image in dpi value uploaded using paperclip - ruby-on-rails

In our Rails Application, we are uploading images using Paperclip gem. I would like to know if there is a way to find DPI value of such an uploaded image?

Related

rails ckeditor image upload went something wrong

I'm using ckeditor-rails, carrierwave, mini-magick gem.
I'm trying to upload image from computer using ckeditor.
I followed some steps README in ckeditor said, but i cannot find the feature what i want(uploading image from local computer to aws, and use that image using url link)
can somebody help me ?
this is my case right now
this is what i want

ActiveStorage How to convert image before upload to S3?

I configured active storage to upload has_one_attached :image to Amazon S3.
product.image.attach(io: open(img_url), filename: "file.jpg")
But I want to optimize images: compress them or convert to .webp
I have mini-magick gem which i can use to modify images.
So can I dynamically modify image from url before uploading to Amazon?
Or all can I do is to save image from url, process it and then do attach? (It is so slow when I have millions of images)
According to ActiveStorage, it supports transformation, so you could try using https://github.com/janko/image_processing with mini magick or libvips convert method to transform the image before saving it. Or at least that's what i'm trying to do atm.
If i manage to do it I'll post it here.
Good luck

Uploading Webcam screenshot with Rails 5 ActiveStorage

Like the new ActiveStorage functionality in Rails 5.2.
My app let's the user take a still form their webcam, which I then need to upload as an attachment.
Does anyone know how to do this with ActiveStorage?
My setup accesses the webcam via JS using navigator.mediaDevices.getUserMedia and copies a still to an image tag via a canvas. I've tried uploading the data from the img tag to ActiveStorage, but either ignores it or gives a signing error.
Any ideas if this is possible and how it could be done??
thanks!

Uploading image from PhoneGap to Carrierwave / Rails 3?

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/

Uploading Images without using ImageMagick

I don't want to have to configure imagemagick but want to use a gem to be able to upload a picture from a form and put it into a database. Are there other options out there? I tried dragonfly and carrierwave but they require ImageMagick.
I often use Blitline which allows we to me to make any edits to the image (if needed) and then I have Blitline store it in an Amazon S3 bucket and place the image url in my database to save space in the database.

Resources