Skip to content

Commit d4543ab

Browse files
committed
fix more spec tests
now all pass, except one which needs a vips fix
1 parent 48d2eaf commit d4543ab

File tree

7 files changed

+21
-25
lines changed

7 files changed

+21
-25
lines changed

ext/image.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ img_data(VALUE obj)
345345
return( Qnil );
346346

347347
return rb_tainted_str_new((const char *) im->data,
348-
IM_IMAGE_SIZEOF_IMAGE(im) );
348+
IM_IMAGE_SIZEOF_LINE(im) * im->Ysize);
349349
}
350350

351351
/*

spec/vips/arithmetic_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def image_mins(image)
101101

102102
it "should return the average location of the image max" do
103103
pending "variable results in git master right now"
104-
@image.maxpos_avg.should == [107.0, 116.5, 248.0]
104+
@image.maxpos_avg.should == [12.0, 116.5, 248.0]
105105
end
106106

107107
it "should return an array of n image max locations" do

spec/vips/colour_spec.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,30 +137,30 @@
137137
im.band_fmt.should == :FLOAT
138138
end
139139

140-
pending "should calculate a CMC color difference image between two lab images" do
140+
it "should calculate a CMC color difference image between two lab images" do
141141
im = @image.srgb_to_xyz.xyz_to_lab
142142
im2 = @image2.srgb_to_xyz.xyz_to_lab
143143
diff = im.decmc_from_lab(im2)
144144
if Spec::Helpers.match_vips_version("> 7.23")
145-
diff.should match_sha1('30d9850f3414d9931d4d90a156a57f1202ba692b')
145+
diff.should match_sha1('91396adda33cc10e71bc79b0cd3cbf449f756d0b')
146146
end
147147
end
148148

149-
pending "should calculate a CIE76 color difference image between two lab images" do
149+
it "should calculate a CIE76 color difference image between two lab images" do
150150
im = @image.srgb_to_xyz.xyz_to_lab
151151
im2 = @image2.srgb_to_xyz.xyz_to_lab
152152
diff = im.de_from_lab(im2)
153153
if Spec::Helpers.match_vips_version("> 7.23")
154-
diff.should match_sha1('f7c261b5d8532c2c34f77039af8754fffe23dcc6')
154+
diff.should match_sha1('e5810662fa9866a39e778bdf73e910c2196e56e9')
155155
end
156156
end
157157

158-
pending "should calculate a CIEDE2000 color difference image between two lab images" do
158+
it "should calculate a CIEDE2000 color difference image between two lab images" do
159159
im = @image.srgb_to_xyz.xyz_to_lab
160160
im2 = @image2.srgb_to_xyz.xyz_to_lab
161161
diff = im.de00_from_lab(im2)
162162
if Spec::Helpers.match_vips_version("> 7.23")
163-
diff.should match_sha1('66d4869acf57df855ced1d38ed308612f6a198f4')
163+
diff.should match_sha1('629b5fb844c1f2e61c5e652f23435297b0ec76f4')
164164
end
165165
end
166166

spec/vips/convolution_spec.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,16 @@
2727
# TODO: some kind of validation of the generated image
2828
end
2929

30-
pending "should perform a seperable convolution with an int mask" do
30+
it "should perform a seperable convolution with an int mask" do
3131
m = VIPS::Mask.new [[1, -2, 3]], 3
3232
im = @image.convsep m
33-
im.should match_sha1('1389e7d7fb3f1646e774ac69d6a8802c26652aa5')
33+
im.should match_sha1('4c017e1d28bbc4833faad83142231a4a88663289')
3434
end
3535

36-
pending "should perform a seperable convolution with a float mask" do
36+
it "should perform a seperable convolution with a float mask" do
3737
m = VIPS::Mask.new [[1.2, -2.1, 3.0]], 3.4
3838
im = @image.convsep m
39-
im.should match_sha1('e6c79ddd45c93b31a77c830c925561c6d2139529')
39+
im.should match_sha1('a3263e83248b79df792d22981ad2c863aa28e887')
4040
end
4141

4242
it "should convolve 8 times, rotating 45 deg each time" do
@@ -72,10 +72,10 @@
7272
im.should match_sha1('78580ff728cca4722c73f610406ac8eba0604ba9')
7373
end
7474

75-
pending "should sharpen an image coded in LABS or LABQ format" do
75+
it "should sharpen an image coded in LABS or LABQ format" do
7676
im = @image.srgb_to_xyz.xyz_to_lab.lab_to_labs.sharpen(7, 1.5, 20, 50, 1, 2)
7777
if Spec::Helpers.match_vips_version("> 7.23")
78-
im.should match_sha1('f46d4ba8b0c16e19af95fcd3518caae0a7c2170d')
78+
im.should match_sha1('f6fdf3136cc01b3f267b80450f4c4419ae22b77a')
7979
end
8080
end
8181

spec/vips/csv_reader_spec.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121

2222
it "should read a csv image" do
2323
im = @reader.read
24-
pending "CSV Images don't currently match the original"
25-
im.should match_image(@image)
24+
im.clip2fmt(:UCHAR).should match_image(@image)
2625
end
2726

2827
it "should read the dimensions from the header" do

spec/vips/csv_writer_spec.rb

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,15 @@
1111
@writer.write(@path)
1212

1313
im = VIPS::Image.csv @path
14-
pending "figure out why a csv image doesn't perfectly match its original"
15-
16-
im.should match_image(@image)
14+
im.clip2fmt(:UCHAR).should match_image(@image)
1715
end
1816

1917
it "should write a csv file with an alternate separator character" do
2018
@writer.separator = '|'
2119
@writer.write(@path)
2220

2321
im = VIPS::Image.csv @path, :separator => '|'
24-
pending "figure out why a csv image doesn't perfectly match its original"
25-
im.should match_image(@image)
22+
im.clip2fmt(:UCHAR).should match_image(@image)
2623
end
2724

2825
it "should create a csv writer" do

spec/vips/morphology_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@
4949
end
5050

5151
it "should detect the +ve edges of zero crossings of an image" do
52-
im = @image.zerox_pos
53-
pending "need validation of Image#zerox_pos"
52+
im = @binary.zerox_pos
53+
im.should match_sha1('b6cf701f906e28948acd8b9c1a6abdb29be111ac')
5454
end
5555

5656
it "should detect the -ve edges of zero crossings of an image" do
57-
im = @image.zerox_neg
58-
pending "need validation of Image#zerox_neg"
57+
im = @binary.zerox_neg
58+
im.should match_sha1('b6cf701f906e28948acd8b9c1a6abdb29be111ac')
5959
end
6060

6161
it "should find the position of the first non-zero pixel from the top and from the left" do

0 commit comments

Comments
 (0)