psd_native 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ba6252238c0a42264e81b13c9ad094d459f937cc
4
- data.tar.gz: a9d7254957111c606e550f1e05217070075c1bc2
3
+ metadata.gz: 3ca7170880c6cfc11f56e1299059a9926bdac2e0
4
+ data.tar.gz: 6ed9335c31bf6f9513cfd2bbf5a35dfec8c526a5
5
5
  SHA512:
6
- metadata.gz: 51b58c58785979aff5206139ba2ba1bdfdb987e464bed797f64922c058c5fd9d286b9b205343f8eee705345b5f2e2a7338ce80bd23f499418cd88d1e7fecc0c4
7
- data.tar.gz: e0fb65e4287bb98cd45362549cebb806e0a3450979756fe20d3b34801f27110812a2093c863fff411ad5f18092a34b11e1570023c88950c2addbc8c998037b6f
6
+ metadata.gz: 5f7e6354f464fe99c4183c4b13d248cb07c82b541e7fdedf44da2632ebb53b63fa89dff365933a5a0b2c5beb62c7969611232ea8e926ce36f41d134a25b44c5e
7
+ data.tar.gz: e59760913c83add6f05131651c5adb41f0e1ed1da7a112d7a4cbe1757c6de071a1f9dcd73b3c7b1914babe7534ae853e8962da48ed4687b7fcb9a5e84e0ef0b8
@@ -16,6 +16,8 @@ VALUE psd_native_mask_apply_bang(VALUE self) {
16
16
  int mask_left = FIX2INT(rb_funcall(mask, rb_intern("left"), 0));
17
17
  int mask_top = FIX2INT(rb_funcall(mask, rb_intern("top"), 0));
18
18
 
19
+ int layer_height = FIX2INT(rb_funcall(layer, rb_intern("height"), 0));
20
+ int layer_width = FIX2INT(rb_funcall(layer, rb_intern("width"), 0));
19
21
  int layer_left = FIX2INT(rb_funcall(layer, rb_intern("left"), 0));
20
22
  int layer_top = FIX2INT(rb_funcall(layer, rb_intern("top"), 0));
21
23
 
@@ -29,6 +31,8 @@ VALUE psd_native_mask_apply_bang(VALUE self) {
29
31
  layer_x = doc_x - layer_left;
30
32
  layer_y = doc_y - layer_top;
31
33
 
34
+ if (layer_x < 0 || layer_x > layer_width || layer_y < 0 || layer_y > layer_height) continue;
35
+
32
36
  color = FIX2UINT(rb_funcall(canvas, rb_intern("[]"), 2, INT2FIX(layer_x), INT2FIX(layer_y)));
33
37
 
34
38
  if (doc_x < 0 || doc_x >= doc_width || doc_y < 0 || doc_y > doc_height) {
@@ -1,3 +1,3 @@
1
1
  module PSDNative
2
- VERSION = "1.1.0"
2
+ VERSION = "1.1.1"
3
3
  end
data/psd_native.gemspec CHANGED
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
21
21
  spec.extensions = ["ext/psd_native/extconf.rb"]
22
22
  spec.require_paths = ["lib", "ext"]
23
23
 
24
- spec.add_runtime_dependency "psd", "~> 2.1.1"
24
+ spec.add_runtime_dependency "psd", ">= 2.1.1"
25
25
  spec.add_runtime_dependency "oily_png", "~> 1.1"
26
26
 
27
27
  spec.add_development_dependency "bundler", "~> 1.3"
data/spec/psd_spec.rb CHANGED
@@ -3,11 +3,17 @@ require 'spec_helper'
3
3
  describe 'PSD' do
4
4
  let(:filename) { 'spec/files/example.psd' }
5
5
 
6
- it 'should open a file without a block' do
7
- psd = PSD.open(filename)
8
- expect(psd).to be_parsed
6
+ it 'should open a file without a block' do
7
+ psd = PSD.new(filename)
8
+ expect(psd).to_not be_parsed
9
9
  expect(psd).to be_an_instance_of(PSD)
10
- end
10
+ end
11
+
12
+ it 'should raise an exception if using open without a block' do
13
+ expect {
14
+ PSD.open(filename)
15
+ }.to raise_error
16
+ end
11
17
 
12
18
  it 'should refuse to open a bad filename' do
13
19
  expect { PSD.open('') }.to raise_error
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: psd_native
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan LeFevre
@@ -14,14 +14,14 @@ dependencies:
14
14
  name: psd
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - '>='
18
18
  - !ruby/object:Gem::Version
19
19
  version: 2.1.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - '>='
25
25
  - !ruby/object:Gem::Version
26
26
  version: 2.1.1
27
27
  - !ruby/object:Gem::Dependency