Getting different results working with SVG files and ImageMagick
When you are working with SVG files and ImageMagick you can get different results on different machines depending on which additional packages you have installed.
From: http://www.imagemagick.org/script/formats.php Show archive.org snapshot
ImageMagick utilizes inkscape if its in your execution path otherwise RSVG. If neither are available, ImageMagick reverts to its internal SVG renderer.
Related cards:
Working with or without time zones in Rails applications
Rails supports time zones, but there are several pitfalls. Most importantly because Time.now
and Time.current
are completely different things and code from gems might use one or the other.
Especially configuring an application that cares only...
SVGOMG allows optimizing SVGs with a live preview
There are many ways to optimize SVGs. Ideally, your build pipeline does that automatically for you (e.g. via postcss-svgo
).
If you want to manually tweak an SVG, you can use SVGOMG which is an applicat...
Creating Filesystems with Ruby and FUSE
The FUSE project allows you to create filesystems in userspace - which means you can create a filesystem without having to get your hands dirty and modify your kernel source. This is insanely cool, and can be used for many purposes. Here we're goi...
Webpack: Automatically generating an icon font from .svg files
Over the years we have tried several solution to have vector icons in our applications. There are many ways to achieve this, from SVGs inlined into the HTML, SVGs inlined in CSS, JavaScript-based solutions, to icon fonts.
Out of all these options...
Freeze (vendor, unpack) a single Ruby gem with and without Bundler
When you need to patch an existing gem, one way is to "vendor" the gem by copying it into the vendor/gems
directory of your Rails project. You can then make any changes you require and Rails will use the vendored version of the gem after a serve...
Images darken when getting converted with ImageMagick
When using ImageMagick to manipulate images, you might see that images get darker when beeing modified by newer versions of ImageMagick.
This usually happens with CMYK images beeing converted to RGB by IM.
Solution
At least in our version of ...
ImageMagick: Converting SVG to raster image formats like PNG or JPEG
Conversion
ImageMagick can convert SVGs to raster image formats.
Example for PNG:
convert input.svg output.png
If the SVG has a size of 24x24 (viewBox="0 0 24 24
"), the resulting PNG will also have a size of 24x24.
Resizing...
Operators "in" and "of" are very inconsistent between CoffeeScript and JavaScript
CoffeeScript and JavaScript (ECMAScript) both have operators in
and of
. Each language use them for more than one purpose. There is not a single case where the same operator can be used for the same purpose in both languages.
Check if an objec...
Deal with different ways of counting weeks and weekdays in Ruby
Depending on where you live, different rules are used to determine the number of the week and a weekday. You have no chance whatsoever to get this...
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 ...