With the dynamic chainable API it's very easy to do conditional processing:
pipeline = ImageProcessing::Vips .source(image) .resize_to_limit(400, 400) if image.path.match?(/\.jpe?g$/i) pipeline = pipeline .saver(interlace: true) # create only interlaced JPEGs, excluding PNGs .sharpen(sigma: 0.5, x1: 2, y2: 10, y3: 20, m1: 0, m2: 3) # sharpen only JPEGs end pipeline.call #=> #<File:/tmp/...>
There was an error while loading. Please reload this page.