Comments (1)
I managed to solve the problem! This guide was all I needed!
Apparently, after every upload, the file is closed(I was trying to have the same file uploaded and transformed into different versions and the first transformation was the only one that was successful. To make the second and third transformation, I had to open the file again as it get closed once the operation is complete.
Here's how I fixed it:
response_1 = Cloudinary::Uploader.upload(@video.thumbnail, :transformation => resized_images[:img_64][:transformation])
@video.update(img_64: response["secure_url"])
response_2 = Cloudinary::Uploader.upload(@video.thumbnail.open, :transformation => resized_images[:img_128][:transformation])
@video.update(img_128: response["secure_url"])
response_3 = Cloudinary::Uploader.upload(@video.thumbnail.open, :transformation => resized_images[:img_256][:transformation])
@video.update(img_256: response["secure_url"])
As you can see, I only needed to add .open
method to the second and third transformation.
Extra resources/guide can be found here
I hope this helps somebody!
from cloudinary_gem.
Related Issues (20)
- NoMethodError (undefined method `cache_storage' for Did you mean? cache_dir): HOT 1
- Add support for lazysizes.js HOT 1
- Image upload error in Safari: Failed to load resource: Request header field Authorization is not allowed by Access-Control-Allow-Headers. HOT 1
- Question: How to conditionally override `resource_type`? HOT 1
- Spaces in Font's name are not escaped HOT 6
- Incorrect documentation for ActiveStorage integration (Rails 6.1.4) HOT 2
- I'm using ActiveStorage and I would like to upload ttf font HOT 2
- Test the library with Ruby 3.0
- How to pass options to ActiveStorage upload? HOT 3
- Cant direct upload raw files HOT 17
- Some kind of overlay texts generate urls which cause `400 Bad Request` HOT 7
- Support Dynamic Folder upload parameters HOT 2
- How to get value txt file? HOT 3
- Update API is missing metadata support HOT 3
- Conditional metadata rules support HOT 6
- Broken urls - Unsafe characters in public_id are not properly escaped by Cloudinary::Utils.cloudinary_url HOT 2
- Photo metadata is nil until after AR callbacks have run HOT 7
- ActiveStorage: Non-image file is not deleted when its blob is destroyed HOT 4
- ActiveStorage support for upload_large HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cloudinary_gem.