Carrierwave: Efficiently converting images
When uploading images, adding more than one process to a version can cause MiniMagick to run multiple commands. In order to have all processing done in one mogrify
system call, you'll need to define only one process that
combines all options
Show archive.org snapshot
you'd like to pass in.
Related cards:
Always convert and strip user-provided images to sRGB
Debugging image color profiles is hard. You can't trust your eyes in this matter, as the image rendering depends on multiple factors. At least the operation system, browser or image viewer software and monitor influence the resulting image colors ...
CarrierWave: Processing images with libvips
When you write your next CarrierWave uploader, consider processing your images with libvips instead of ImageMagick.
Reasons for libvips
There are several **upsi...
Carrierwave: always limit images to a reasonable size
Today's cameras create huge images, some beyond 50MB. Unless you need to offer this large files, you should always shrink uploaded files to a reasonable resolution.
class ImageUploader < CarrierWave::Uploader::Base
process resize_to_...
Carrierwave – Recreate versions
A snippet of the carrierwave documentation
You might come to a situation where you want to retroactively change a version or add a new one. You can use the recreate_vers...
Updated: CarrierWave: Processing images with libvips
mutate
blocks are only required for draw operations, and for writing metadata. You cannot call operations like scale()
on mutable images.
Even though most libvips operations return a new, immutable Vips::Image
, libvips uses a clever interna...
An incomplete guide to migrate a Rails application from paperclip to carrierwave
In this example we assume that not only the storage gem changes but also the file structure on disc.
A general approach
Part A: Create a commit which includes a script that allows you to copy the existing file to the new file structure.
...
Checklist: Using Carrierwave in a Rails project
This checklist should help you to check edge cases that are not part of the default Carrierwave configuration.
- Check Default Configuration and Suggested Changes
- Use [secret URLs](/makandra/16999-common-mistakes-when-storin...
Declare different CSS background-images for different locales
If you would like to use language specific layout (e.g. background-images) in your applications stylesheets you can achieve this easily by using the lang
attribute in your views (ERB):
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<%...
Howto provide a single page preview for PDF & TXT with carrierwave
Assert rmagick
provision ...
Gemfile
gem 'rmagick', '2.13.2' # at this moment the latest stable version
config/initializer/carrierwave.rb
require 'carrierwave/processing/rmagick'
... and define a custom processor
`My...
How to: Upgrade CarrierWave to 3.x
While upgrading CarrierWave from version 0.11.x to 3.x, we encountered some very nasty fails. Below are the basic changes you need to perform and some behavior you may eventually run into when upgrading your application. This aims to save you some...