@@ -220,7 +220,7 @@ def has_jpeg?
220
220
221
221
if has_jpeg?
222
222
it "can load a sample jpg image buffer" do
223
- str = File . open ( simg ( "wagon.jpg" ) , "rb" ) . read
223
+ str = File . binread ( simg ( "wagon.jpg" ) )
224
224
x = Vips ::Image . new_from_buffer str , ""
225
225
expect ( x . width ) . to eq ( 685 )
226
226
expect ( x . height ) . to eq ( 478 )
@@ -231,7 +231,7 @@ def has_jpeg?
231
231
232
232
if has_jpeg?
233
233
it "can load a sample jpg image utf-8 buffer" do
234
- str = File . open ( simg ( "wagon.jpg" ) , "r" ) . read
234
+ str = File . read ( simg ( "wagon.jpg" ) )
235
235
x = Vips ::Image . new_from_buffer str , ""
236
236
expect ( x . width ) . to eq ( 685 )
237
237
expect ( x . height ) . to eq ( 478 )
@@ -257,7 +257,7 @@ def has_jpeg?
257
257
if has_jpeg?
258
258
it "can set an ICC profile on a jpg image" do
259
259
x = Vips ::Image . new_from_file simg ( "icc.jpg" )
260
- profile = File . open ( simg ( "lcd.icc" ) , "rb" ) . read
260
+ profile = File . binread ( simg ( "lcd.icc" ) )
261
261
x = x . copy
262
262
x . set_value "icc-profile-data" , profile
263
263
x . write_to_file ( timg ( "x.jpg" ) )
0 commit comments