Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
= Manipulator
S3 is great for storing image files, but manipulating images after they've been saved to S3 (rotating, resizing, cropping, etc.) is a bit of a chore. Usually it goes something like this:
After re-implementing this pattern a few times over (and filling up /tmp by forgetting the last step), we decided to roll this into a gem that makes S3 image manipulation as easy as:
m = Manipulator.new(:processor => :gm) # use GraphicsMagick; defaults to ImageMagick m.manipulate({:bucket => 'my-bucket', :key => 'some/file.jpg'}) do |img| img.rotate(90) img.resize_to_fit(75,75) end
The idea is to instantiate a Manipulator and then pass it a bucket name and key to manipulate. Manipulator will download your image to a local tmp file, then yield a MiniMagick::Image wrapping that file. Call methods on the yielded image to make modifications; as soon as the block returns, the modified image is pushed back to S3 and the tmp file is removed.
We're using MiniMagick now instead of RMagick to save memory - we found that RMagick was a hog. MiniMagick is a lot more straightforward and has a nice interface for both GraphicsMagick (recommended) and ImageMagick.
Want to do something that MiniMagick doesn't directly support, like removing all profiles from an image with GraphicsMagick (aka ImageMagick's strip method)?
m.manipulate('my-bucket', 'my-key' do |img|
gm mogrify +profile '*' #{manipulator.temp_file_path}
end
== Install
$ gem install manipulator
== Dependencies
== Future
== Copyright
Copyright (c) 2010 The New York Times Company. See LICENSE for details.
FAQs
Unknown package
We found that manipulator demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.