
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Non-blocking transformation and image writing in Ruby, powered by VIPS
apt-get install libvips-dev
, or follow the guidelines at: https://github.com/jcupitt/libvipsIf you installed it from source, make sure:
require 'rubygems'
require 'async_vips'
include AsyncVips
# Non-blocking scaling of an image:
# Allowed symbols are: :load, :scale_x, :scale_y, :save
# Wneh called, a function is invoked on a separate native thread.
# The callback-proc is invoked on a separate Ruby thread on completion.
AsyncVips.transform(:load => srcfile, :scale_x => 800, :save => dstfile) do |img|
if(img.error != nil)
puts img.error
end
end
# Set the number of operations cached by VIPS:
AsyncVips.set_cache(100)
# Get image information:
# Allowed symbols are: :load
AsyncVips.info(:load => srcfile) do |img|
puts img.src # image filepath
puts img.width # image width
puts img.height # image height
puts img.size # image size in bytes
end
## Using event machine
require 'rubygems'
require 'async_vips'
require 'eventmachine'
include AsyncVips
#puts AsyncVips::VERSION
#puts AsyncVips::LIB_VERSION
AsyncVips.set_cache(0) # sets the number of operations cached by VIPS
EM.run do
EM.add_timer(3) do
source = './images/*.JPG'
files = Dir[source]
files.each do |srcfile|
dstfile = './output/'+File.basename(srcfile)
AsyncVips.transform(:load => srcfile, :scale_x => 800, :save => dstfile) do |img|
puts img.src
if(img.error != nil)
puts img.error
end
end
end
end
EM.add_periodic_timer(1) do
puts "#{Time.now}"
end
end
```ruby
## Version history
### 1.2.1 - added support for natural_orientation flag
### 1.1.0 - shrink operation
### 1.0.0 - initial release
FAQs
Unknown package
We found that async-ruby-vips demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.